mmap how does kernel know a page is mmaped

Valdis.Kletnieks at vt.edu Valdis.Kletnieks at vt.edu
Thu Jul 25 14:17:31 EDT 2013


On Thu, 25 Jul 2013 10:52:43 -0700, kernel neophyte said:

> I am sorry maybe I did not ask the question correctly, all I want to know
> is how mmap works underneath, given an address X how does kernel figure out
> its a mmaped page ?

You missed the point.

The kernel never checks if it's an mmap'ed page.  It merely checks is this
a mapped page, the same way it checks every single other memory reference
whether it's a code segment, your stack, your heap...  it doesn't care
that address 0x3FB0CCF0 is mmap'ed or not.  It just cares "does this throw
a pagefault when I reference it?" - and then it gets handled just like
any other page fault.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 865 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130725/95a07378/attachment.bin 


More information about the Kernelnewbies mailing list