Re: Resurrecting the VM_PINNED discussion

Christoph Lameter
2015-03-03T19:51:18Z

On Tue, 3 Mar 2015, Eric B Munson wrote:

> > So you are saying that mlocking (VM_LOCKED) prevents migration and thus
> > compaction to do its job? If that's true, I think it's a bug as it is AFAIK
> > supposed to work just fine.
>
> Agreed. But as has been discussed in the threads around the VM_PINNED
> work, there are people that are relying on the fact that VM_LOCKED
> promises no minor faults. Which is why the behavoir has remained.

AFAICT mlocking preventing migration is something that could be taken out.
Google removes the restriction.

mlocked does not promise no minor faults only that the page will stay
resident. The pinning results in no faults.

> VM_PINNED itself doesn't help us, but it would allow us to make
> VM_LOCKED use only the weaker 'no major fault' semantics while still
> providing a way for anyone that needs the stronger 'no minor fault'
> promise to get the semantics they need.

The semantics for mlock allow migration and therefore defrag as well as
thp processing.