Re: mlockall and mmap of IO devices don't mix

From: Andrew Morton
Date: Fri Oct 03 2003 - 18:07:48 EST


Joe Korty <joe.korty@xxxxxxxx> 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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/