Re: get_user_pages() and shared memory question

From: Roland Dreier
Date: Tue Jun 21 2005 - 12:35:48 EST

Timur> Hi, Is it possible for a page of memory that's been
Timur> "grabbed" with get_user_pages() to ever be allocated to
Timur> another process? I'm assuming the answer is no, but I have
Timur> a specific case I want to ask about.

Not to the best of my knowledge, although you should probably read the
code to convince yourself.

Timur> Until 2.6.7, there was a bug in the VM where a page that
Timur> was grabbed with get_user_pages() could be swapped out.
Timur> Those of you familar with the OpenIB work know what I'm
Timur> talking about. Would that bug affect anything I'm talking
Timur> about?

This isn't what the bug caused. What could happen was that the
swapper could unmap a page from a process's virtual memory map before
it noticed that the page had an elevated reference count. The page
wouldn't get swapped out, but when the process caused a page fault to
bring the virtual address back, it would get a different piece of
physical memory.

- R.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at