lkml.org 
[lkml]   [2020]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch] mm, oom: stop reclaiming if GFP_ATOMIC will start failing soon
From
Date
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
>

\
 
 \ /
  Last update: 2020-04-25 02:33    [W:0.099 / U:2.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site