Thread (25 messages) 25 messages, 6 authors, 2016-09-30

Re: More OOM problems (sorry fro the mail bomb)

From: Raymond Jennings <hidden>
Date: 2016-09-30 19:48:57

On Thu, Sep 29, 2016 at 2:20 PM, Vlastimil Babka [off-list ref] wrote:
On 09/29/2016 10:08 PM, Raymond Jennings wrote:
quoted
 Suggestion:

 1.  Make it a background process "kcompactd"
 2.  It is activated/woke up/semaphored awake any time a page is 
freed.
 3.  Once it is activated, it enters a loop:
 3.1.  Reset the semaphore.
 3.2.  Once a cycle, it takes the highest movable page
 3.3.  It then finds the lowest free page
 3.4.  Then, it migrates the highest used page to the lowest free 
space
 3.5.  maybe pace itself by sleeping for a teensy, then go back to 
step
 3.2
 3.6.  Do one page at a time to keep it neatly interruptible and 
keep it
 from blocking other stuff.  Since compaction is a housekeeping 
task, it
 should probably be eager to yield to other things.
 3.7.  Probably leave hugepages alone if detected since they are by
 definition fairly defragmented already.
 4.  Once all gaps are backfilled, go back to sleep and park back at
 step 2 waiting for the next wakeup.

 Would this be a good way to do it?
Yes, that's pretty much how it already works, except movable pages are
taken from low pfn and free pages from high. Then there's ton of 
subtle
issues to tackle, mostly the balance between overhead and benefit.
Besides the kswapd hook, what would nudge kcompactd to run?  If its not 
proactively nudged after a page is freed how will it know that there's 
fragmentation that could be taken care of in advance before being 
shoved by kswapd?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help