lkml.org 
[lkml]   [2007]   [Jan]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] Track mlock()ed pages
Andrew Morton wrote:

> Of course it would. But how do you know it is "too expensive"? We "scan
> all the vmas mapping a page" as a matter of course in the page scanner -
> millions of times a minute. If that's "too expensive" then ouch.

We can do it lazily.

At mlock time, move pages onto the mlocked list, unless they
are there already.

On munlock, move pages to the active list. For mlock-only
memory (shared memory segments?) we could add a simple check
to see if the next process on the list has the page mlocked,
checking only that one.

While scanning the active list, move mlocked pages that are
found back onto the mlocked list.

This lazy movement of pages will impact shared libraries,
but probably not shared memory segments.

Does this sound workable?

--
Politics is the struggle between those who want to make their country
the best in the world, and those who believe it already is. Each group
calls the other unpatriotic.
-
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: 2007-01-27 23:23    [W:0.048 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site