Re: [RFC] mm: Proactive compaction

From: John Hubbard
Date: Tue Sep 17 2019 - 15:46:35 EST


On 9/16/19 1:16 PM, David Rientjes wrote:
> On Fri, 16 Aug 2019, Nitin Gupta wrote:
...
>
> We've had good success with periodically compacting memory on a regular
> cadence on systems with hugepages enabled. The cadence itself is defined
> by the admin but it causes khugepaged[*] to periodically wakeup and invoke
> compaction in an attempt to keep zones as defragmented as possible

That's an important data point, thanks for reporting it.

And given that we have at least one data point validating it, I think we
should feel fairly comfortable with this approach. Because the sys admin
probably knows when are the best times to steal cpu cycles and recover
some huge pages. Unlike the kernel, the sys admin can actually see the
future sometimes, because he/she may know what is going to be run.

It's still sounding like we can expect excellent results from simply
defragmenting from user space, via a chron job and/or before running
important tests, rather than trying to have the kernel guess whether
it's a performance win to defragment at some particular time.

Are you using existing interfaces, or did you need to add something? How
exactly are you triggering compaction?

thanks,
--
John Hubbard
NVIDIA