lkml.org 
[lkml]   [2006]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Patch 3/3] prepopulate/cache cleared pages

* Nick Piggin <nickpiggin@yahoo.com.au> wrote:

> I'm worried about the situation where we allocate but don't use the
> new page: it blows quite a bit of cache. Then, when we do get around
> to using it, it will be cold(er).

couldnt the new pte be flipped in atomically via cmpxchg? That way we
could do the page clearing close to where we are doing it now, but
without holding the mmap_sem.

to solve the pte races we could use a bit in the [otherwise empty] pte
to signal "this pte can be flipped in from now on", which bit would
automatically be cleared if mprotect() or munmap() is called over that
range (without any extra changes to those codepaths). (in the rare case
if the cmpxchg() fails, we go into a slowpath that drops the newly
allocated page, re-lookups the vma and the pte, etc.)

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

\
 
 \ /
  Last update: 2006-02-23 14:33    [W:0.077 / U:0.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site