Re: [PATCH] mm, oom: consider present pages for the node size

From: David Rientjes
Date: Thu Aug 29 2019 - 18:20:20 EST


On Thu, 29 Aug 2019, Michal Hocko wrote:

> From: Michal Hocko <mhocko@xxxxxxxx>
>
> constrained_alloc calculates the size of the oom domain by using
> node_spanned_pages which is incorrect because this is the full range of
> the physical memory range that the numa node occupies rather than the
> memory that backs that range which is represented by node_present_pages.
>
> Sparsely populated nodes (e.g. after memory hot remove or simply sparse
> due to memory layout) can have really a large difference between the
> two. This shouldn't really cause any real user observable problems
> because the oom calculates a ratio against totalpages and used memory
> cannot exceed present pages but it is confusing and wrong from code
> point of view.
>
> Noticed-by: David Hildenbrand <david@xxxxxxxxxx>
> Signed-off-by: Michal Hocko <mhocko@xxxxxxxx>

Acked-by: David Rientjes <rientjes@xxxxxxxxxx>