pre-cleaning
Hi,
Was chating with Rik on #kernelnewbies and cameup with the following idea:
Assuming we have changes things to look a bit more like bsd and are scanning the mm array looking for pages to free. Once we have our quota of free pages we save a pointer to the last scanned page (freed_to). Then we continue scanning for N entries writing out dirty pages (can we cluster these writes?) we save a pointer to the last precleaned page in (cleaned_to) and record the number of precleaned pages in (pre_clean). Next scan time the idea is most of the precleaned pages will still be clean. We check this by recording the number of pages we have to reclean in (re_clean). We set things up so N entires should free about the same number of pages as the last called required us to free. We can use the re_clean/pre_clean ratio to decide if we are doing any good, if not we reduce the number of pages we preclean... If everything is ok a normal scan should compelete, having freed enought pages, when freed_to = the old cleaned_to.
Thoughts it might be better to create an array for a stucture with three counters in it
precleaned - number of pages precleaned in this segement
recleaned - number of pages relceaned (want this near zero)
cleaned - number of pages we had to clean during freeing (not recleaned)
say i is the index in the mm array and j = i/2^k,
where j indexes the above stucture
we use the sum of [(freed_to/2^k)-x, (freed_to/2^k)-1] numbers to autotune the preclean logic
if recleaned*100 div precleaned > threshold1 then n =/ 2 else if cleaned*100 div precleaned > threshold2 then N =* 2
Signature · 6 lines
Ed Tomlinson (ontadata) <[email protected]> -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux.eu.org/Linux-MM/