Re: [patch] mm, oom: stop reclaiming if GFP_ATOMIC will start failing soon
From: Tetsuo Handa
Date: Fri Apr 24 2020 - 20:32:27 EST
On 2020/04/25 5:48, David Rientjes wrote:
> @@ -4372,11 +4372,21 @@ should_reclaim_retry(gfp_t gfp_mask, unsigned order,
> ac->nodemask) {
> unsigned long available;
> unsigned long reclaimable;
> + unsigned long free;
> unsigned long min_wmark = min_wmark_pages(zone);
> bool wmark;
>
> + free = zone_page_state_snapshot(zone, NR_FREE_PAGES);
> + /*
> + * If this zone is approaching the point where even order-0
> + * GFP_ATOMIC allocations will fail, stop considering reclaim.
> + */
> + if (!__zone_watermark_ok(zone, 0, min_wmark, ac_classzone_idx(ac),
> + alloc_flags | ALLOC_HIGH, free))
> + continue;
This is to trigger the OOM killer more aggressively, isn't it? But where is the
guarantee that this is an allocation request which can trigger the OOM killer?
If this is an allocation request which cannot trigger the OOM killer, wouldn't
this cause premature allocation failures?
> +
> available = reclaimable = zone_reclaimable_pages(zone);
> - available += zone_page_state_snapshot(zone, NR_FREE_PAGES);
> + available += free;
>
> /*
> * Would the allocation succeed if we reclaimed all
>