On Tue, 2009-12-01 at 21:23 +0900, KOSAKI Motohiro wrote: > (cc to some related person) > > At first look, > > - We have to fix this issue certenally. > - But your patch is a bit risky. > > Your patch treat trylock(pte-lock) failure as no accessced. but > generally lock contention imply to have contention peer. iow, the page > have reference bit typically. then, next shrink_inactive_list() move it > active list again. that's suboptimal result. > > However, we can't treat lock-contention as page-is-referenced simply. if it does, > the system easily go into OOM. > > So, > if (priority < DEF_PRIORITY - 2) > page_referenced() > else > page_refenced_trylock() > > is better? > On typical workload, almost vmscan only use DEF_PRIORITY. then, > if priority==DEF_PRIORITY situation don't cause heavy lock contention, > the system don't need to mind the contention. anyway we can't avoid > contention if the system have heavy memory pressure. > Agreed. The attached updated patch only does a trylock in the page_referenced() call from shrink_inactive_list() and only for anonymous pages when the priority is either 10, 11 or 12(DEF_PRIORITY-2). I have never seen a problem like this with active pagecache pages and it does not alter the existing shrink_page_list behavior. What do you think about this???