linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* get_user_pages() still broken in 2.6
@ 2004-09-28 22:40 Timur Tabi
  2004-09-28 23:03 ` Christoph Hellwig
  2004-09-29  4:49 ` opening a file inside the kernel module Rakesh Jagota
  0 siblings, 2 replies; 10+ messages in thread
From: Timur Tabi @ 2004-09-28 22:40 UTC (permalink / raw)
  To: linux-mm, linux-kernel, kernelnewbies

I was hoping that this bug would be fixed in the 2.6 kernels, but 
apparently it hasn't been.

Function get_user_pages() is supposed to lock user memory.  However, 
under extreme memory constraints, the kernel will swap out the "locked" 
memory.

I have a test app which does this:

1) Calls our driver, which issues a get_user_pages() call for one page.
2) Calls our driver again to get the physical address of that page (the 
driver uses pgd/pmd/pte_offset).
3) Tries allocate 1GB of memory (this system has 1GB of physical RAM).
4) Tries to get the physical address again.

In step 4, the physical address is usually zero, which means either 
pgd_offset or pmd_offset failed.  This indicates the page was swapped out.

I don't understand how this bug can continue to exist after all this 
time.  get_user_pages() is supposed to lock the memory, because drivers 
use it for DMA'ing directly into user memory.

-- 
Timur Tabi
Staff Software Engineer
timur.tabi@ammasso.com
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

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

end of thread, other threads:[~2004-09-29 15:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-28 22:40 get_user_pages() still broken in 2.6 Timur Tabi
2004-09-28 23:03 ` Christoph Hellwig
2004-09-28 23:21   ` Dave Hansen
2004-09-29 14:46     ` Timur Tabi
2004-09-29 14:48   ` Timur Tabi
2004-09-29 15:01     ` Christoph Hellwig
2004-09-29  4:49 ` opening a file inside the kernel module Rakesh Jagota
2004-09-29  5:00   ` Jeff Garzik
2004-09-29  5:56     ` Rakesh Jagota
2004-09-29 15:52       ` Stuart MacDonald, linux-kernel-owner

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