Re: [PATCH 07/11] unpaged: COW on VM_UNPAGED

From: Hugh Dickins
Date: Fri Nov 18 2005 - 02:28:41 EST

On Thu, 17 Nov 2005, David S. Miller wrote:
> From: Nick Piggin <nickpiggin@xxxxxxxxxxxx>
> Date: Fri, 18 Nov 2005 16:46:56 +1100
> > I think for 2.6.15, yes. We [read: I :(] was too hasty in removing
> > this completely.

No, that was not too hasty: we all agreed that the case _ought_ not to
arise, and we hadn't worked out the right code to handle it if it did
arise. What was disappointing is that nobody reported the messages
while it was in -mm, but

> > However I think it would not be unresonable to spit
> > out a warning, and remove it in 2.6.??
> I am so convinced that handling COW faults on VM_RESERVED is
> unnecessary, that I think it's prudent to spit out a warning
> for MAP_PRIVATE+VM_RESERVED and changing it to MAP_SHARED
> to complete the mmap() call.
> I bet every single application still works.
> And we'll have none of this rediculious complex crap handling COW
> pages in VM_RESERVED areas, which I believe is seriously more
> complicated than what we started with before any of the VM_RESERVED
> changed went into 2.6.15. In fact, we might as well go back to the
> 2.6.14 stuff instead. I do not see the second half of Hugh's patches
> as progress, it's a severe regression to even 2.6.14
> Doing a get_user_pages() on a VM_UNPAGED area, that's sane, and
> we know exactly what makes use of that. COW faults on VM_UNPAGED
> areas, that's not sane, and we don't know of a single instance
> which correctly needs that behavior.
> MAP_SHARED mappings of reserved pages shared between driver, device,
> and userspace is common and understandable. But MAP_PRIVATE mappings
> of such things? Please show me an example of something legitimately
> using that, and not doing so by mistake. I will drop all of my
> arguments once I see that :-)
> Because, frankly, a lot of these COW on VM_UNPAGED patches seemingly
> are derived from studying the MM and a few drivers and saying "oh yes,
> that's _possible_" but that is far from being enough to justify this
> complexity. We really need to see real usage, that makes sense.
> All the cases I've investigated in userspace are "they really want
> MAP_SHARED" or "they didn't need PROT_WRITE in the first place".
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at