mmap behavior
- From: ochedru@xxxxxxxxx
- Date: 18 Sep 2006 08:05:33 -0700
The following code behaves differently between kernel 2.4 and kernel
2.6:
size_t length = 0x40000000; /* 1GB */
void *addr = mmap (0, length, PROT_NONE, MAP_SHARED|MAP_ANONYMOUS, 0,
0);
With kernel 2.4, this 1GB mapping does not account for the process' VM
size, and this is IMHO the expected behavior, since the reserved
address space is not accessible (PROT_NONE).
With kernel 2.6, the 1GB mapping accounts for the process' VM size. The
process vsize as reported in /proc/pid/statm is > 1GB and I get the
following entry in pmap output:
0000002a9557a000 1048576K ---s- /dev/zero (deleted)
Any advice?
Thanks,
Olivier.
.
- Follow-Ups:
- Re: mmap behavior
- From: David Schwartz
- Re: mmap behavior
- Prev by Date: Re: How to configure Linux kernel source tree hierarchy
- Next by Date: Re: linux sleep implementation
- Previous by thread: RFI:Emulating large filesystems.
- Next by thread: Re: mmap behavior
- Index(es):
Relevant Pages
|