[lkml]   [2003]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: mlockall and mmap of IO devices don't mix
Joe Korty <> wrote:
> > Something like this?
> Sigh. No go; it *looks* good but my app still locks up....

Oh crap, you're mapping /dev/mem rather than going through a device driver.
/dev/mem isn't setting VM_IO.

Does this little experiment make it go?

diff -puN drivers/char/mem.c~a drivers/char/mem.c
--- 25/drivers/char/mem.c~a Fri Oct 3 16:04:04 2003
+++ 25-akpm/drivers/char/mem.c Fri Oct 3 16:04:15 2003
@@ -176,7 +176,7 @@ static int mmap_mem(struct file * file,
* Don't dump addresses that are not real memory to a core file.
- if (uncached)
+// if (uncached)
vma->vm_flags |= VM_IO;

if (remap_page_range(vma, vma->vm_start, offset, vma->vm_end-vma->vm_start,

Course I could test it myself...

I wonder what to do. Perhaps /dev/mam should set VM_IO if any of the
mapped pages are not valid mem_map-style pageframes. Or maybe it should
just set VM_IO all the time.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:49    [W:0.051 / U:6.540 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site