Re: VM_RESERVED [was Re: mapping user space buffer to kernel address space]

From: Linus Torvalds (torvalds@transmeta.com)
Date: Fri Oct 20 2000 - 12:44:40 EST


On Fri, 20 Oct 2000, Andrea Arcangeli wrote:
>
> The page count of the mapped pages should be ok, it seems those mapped pages
> have a reference count of 1 just from the vmalloc allocation and they use
> PG_reserved just to skip swap_out, but I feel safer too if the bttv maintainers
> will check it and send it to you themself after checking it's correct. (I only
> verified that it was compiling correctly)

Note that the page count should _not_ be one: the page could should be
1+nr_of_mappings.

Basically, the "nopage()" function has to do a "get_page(page)". But if
the page is marked PG_reserved, that would hide a bug in a drievr that
doesn't do that part.

Also, I suspect some drivers do the "remap_page_range() one page at a
time", and again exactly due to page count issues remap_page_range() will
refuse to touch pages that aren't marked PG_reserved. So I wholeheartedly
agree with your change, but I just suspect it will break drivers that have
depended on the fact that PG_reserved means that they can be lazy and not
bother about getting all the details right.

Not that I mind breaking drivers in general, but not right now.

                Linus

-
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:16 EST