public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* get_user_pages() and shared memory question
@ 2005-06-21 15:10 Timur Tabi
  2005-06-21 17:33 ` Roland Dreier
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Timur Tabi @ 2005-06-21 15:10 UTC (permalink / raw)
  To: Linux Kernel Mailing List

Hi,

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

Let's say an application allocates some shared memory, and then calls into a driver which 
calls get_user_pages().  The driver exits without releasing the pages, so they now have a 
reference count on them.  Then the application deallocates the shared memory.  At this 
point, the virtual addresses disappear, and no process owns them, but the pages still have 
a reference count.

Another process now tries to allocate a shared memory buffer.  Is there any way that this 
new buffer can contain those pages that were grabbed with get_user_pages() (i.e. that 
already have a reference count)?

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

-- 
Timur Tabi
Staff Software Engineer
timur.tabi@ammasso.com

One thing a Southern boy will never say is,
"I don't think duct tape will fix it."
      -- Ed Smylie, NASA engineer for Apollo 13

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-06-21 19:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-21 15:10 get_user_pages() and shared memory question Timur Tabi
2005-06-21 17:33 ` Roland Dreier
2005-06-21 18:02 ` Hugh Dickins
2005-06-21 18:21   ` Timur Tabi
2005-06-21 19:38     ` Hugh Dickins
2005-06-21 19:43 ` Brice Goglin
2005-06-21 19:55   ` Timur Tabi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox