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

From: Joe Korty
Date: Fri Oct 03 2003 - 18:31:16 EST


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

You're right; I just tried your original patch with a real device driver
and it worked.


> Does this little experiment make it go?
> - if (uncached)
> +// if (uncached)

Yes it does....

(am about to look at and try your third patch out).

Comments of the first patch:

vm_io = vma->vm_flags & VM_IO;

uses 'vma' before it has been established that vma is a
non-NULL pointer. Perhaps we should go back to just using
(vma_flags &VM_IO) everywhere it is needed?

Also, conside changing

while (!vm_io && !(map = follow_page(mm,start,write))) {
to
if (!vm_io) {
while (!(map = ...))) {
....
}
if (pages) {
....
}
}

as it more clearly codes up the intended effect, rather than relying
on side effects ('pages' happens to be NULL whenever VM_IO is set).

Joe
-
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/