On Mon 23-01-17 11:04:12, Mel Gorman wrote: [...] > 1. In should_reclaim_retry, account for SLAB_RECLAIMABLE as available > pages when deciding to retry reclaim
I am pretty sure I have considered this but then decided to not go that way. I do not remember details so I will think about this some more. It might have been just "let's wait for the real issue here". Anyway we can give it a try and it would be as simple as diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 94ebd30d0f09..87221491be84 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -3566,7 +3566,7 @@ should_reclaim_retry(gfp_t gfp_mask, unsigned order, unsigned long min_wmark = min_wmark_pages(zone); bool wmark; - available = reclaimable = zone_reclaimable_pages(zone); + available = reclaimable = zone_reclaimable_pages(zone) + zone_page_state_snapshot(zone, NR_SLAB_RECLAIMABLE); available -= DIV_ROUND_UP((*no_progress_loops) * available, MAX_RECLAIM_RETRIES); available += zone_page_state_snapshot(zone, NR_FREE_PAGES); I am not sure it would really help much on its own without further changes to how we scale LRU->slab scanning. Could you give this a try on top of the mmotm or linux-next tree? > 2. Stall in should_reclaim_retry for __GFP_NOFAIL|__GFP_NOFS with a > comment stating that the intent is to allow kswapd make progress > with the shrinker The current mmotm tree doesnt need this because we no longer trigger the oom killer for this combinations of flags. > 3. Stall __GFP_NOFS in direct reclaimer on a workqueue when it's > failing to make progress to allow kswapd to do some work. This > may be impaired if kswapd is locked up waiting for a lock held > by the direct reclaimer > 4. Schedule the system workqueue to drain slab for > __GFP_NOFS|__GFP_NOFAIL. > > 3 and 4 are extremely heavy handed so we should try them one at a time. I am not even sure they are really necessary. -- Michal Hocko SUSE Labs