Re: mapping user space buffer to kernel address space

From: Andrea Arcangeli (andrea@suse.de)
Date: Mon Oct 16 2000 - 17:49:19 EST


On Mon, Oct 16, 2000 at 02:59:59PM -0700, Linus Torvalds wrote:
> No. Because "pinning" is _stupid_.

Pinning using map_user_kiobuf looks just the other way around of what we do
usually with the mmap callback of the device driver and remap_page_range. I
considered "pinning" just to convert the user page to one of the pages mapped
with remap_page_range so they can threat them in the same way internally in the
device driver (and the ones mapped with remap_page_range don't get unmapped
and then into swap of course).

> Instead, the Linux answer is to say: pinning is bad, pinning is stupid,
> pinning is useless - so dont do it.

So just delete map_user_kiobuf from your tree if people shouldn't do it. That
would fix the mm corruption too indeed. I don't see why you provide that
functionality and then you keep telling people not to use it. Also rawio
and networking could use the other way around. I think that's mainly a
matter of API. People is used to think in read/write terms. And infact rawio
doesn't provide a completly transpartent read/write because it have constrants
on the buffer alignment.

If you won't delete map_user_kiobuf from your tree I think I've just provided a
real world MM corruption case where the user send the bug report back to us if
we only increase the reference count of the page to pin it.

Andrea
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Oct 23 2000 - 21:00:10 EST