Re: Best way to pin a page in ext4?
From: Hugh Dickins <hughd@google.com>
Date: 2014-09-17 20:39:25
Also in:
linux-mm
On Wed, 17 Sep 2014, Peter Zijlstra wrote:
On Tue, Sep 16, 2014 at 10:31:24PM -0500, Christoph Lameter wrote:quoted
On Tue, 16 Sep 2014, Hugh Dickins wrote:quoted
On the page migration issue: it's not quite as straightforward as Christoph suggests. He and I agree completely that mlocked pages should be migratable, but some real-time-minded people disagree: so normal compaction is still forbidden to migrate mlocked pages in the vanilla kernel (though we in Google patch that prohibition out). So pinning by refcount is no worse for compaction than mlocking, in the vanilla kernel.Note though that compaction is not the only mechanism that uses page migration.
True: offhand, I think memory hotremove, and CMA, and explicit mempolicy changes, are all (for good reason) allowed to migrate mlocked pages; but the case which most interests many is migration for compaction.
Agreed, and not all migration paths check for mlocked iirc. ISTR it is very much possible for mlocked pages to get migrated in mainline.
I think all the checks are for unevictable; and certainly we permit races whereby an mlocked page may miss the unevictable LRU, until subsequent reclaim corrects the omission. But I think that's the extent to which mlocked pages might be migrated for compaction at present. Hugh