Vince Weaver wrote: > some more info on mmap locations. > > I ran some tests on a lot of machines, and only then thought to look > things up. It looks like the grow-top-down was introduced on Linux 2.6.9, > at least for x86: http://lwn.net/Articles/91829/ > > In any case, what follows are results from real systems, showing that > different architectures have different behaviors. > > The mmap values shownare the 3 mmap calls done by gzip.log spec2k full > reference input set. > > x86_64 (Linux 2.6.28.7) (grows down) > 0xfffffffff43e3000 0xfffffffff07c9000 0xffffffffecbaf000 > > i686 Core Duo (Linux 2.6.30.1) (grows down) > 0xb43e4000 0xb07ca000 0xacbb0000 > > i686 Pentium III (Linux 2.6.18) (grows down) > 0xb4390000 0xb0776000 0xacb5c000 > > i686 Pentium 4 (Linux 2.6.11) (grows down) > 0xb40e4000 0xb01ca000 0xac2b0000 > > i686 Pentium 4 (Linux 2.4.18) (grows up) > 0x40001000 0x43c1b000 0x47835000 > > Alpha EV6 (Linux 2.6.21) (grows up) > 0x20000002000 0x20003c1c000 0x20007836000 > > Mips r12k (Linux 2.6.26.8) (grows up) > 0x2aab8000 0x2e6d2000 0x322ec000 > > Ultrasparc II (Linux 2.6.30.1) (grows down) > 0xf4372000 0xf0758000 0xecb3e000 > > >
Thank you for these numbers. The kernel I ran my comparison on was 2.6.24-gentoo-r3 running on a 64 bit CPU, since upgraded to 2.6.27.10. I was thinking about this the other day, and it occurred to me that the simple hello world program I compared against probably didn't do very much with mmap. I ran it again just now under strace, and it appears to call mmap exactly once to map one page anonymously. I'd guess that's to provide a buffer for stdout, the only file IO it does. Since it only happens once, it's indistinguishable whether mmap grows up or down, and I would bet from your results and the failures you saw that it should grow down. We could either make M5's implementation grow down for x86 which would be more realistic, or adjust the mmap address to work with it growing up which would be simpler to implement. Does anyone have an opinion on which is better? I'd like to do use the first approach, but I'm not sure it's worth the complexity. Gabe _______________________________________________ m5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/m5-dev
