Re: [PATCH v4] mm: oom: introduce cpuset oom

From: Waiman Long
Date: Thu Aug 17 2023 - 12:47:16 EST


On 8/17/23 04:40, Gang Li wrote:

Since __GFP_HARDWALL is set as long as cpuset is enabled, I think we can
use it to determine if we are under the constraint of CPUSET.

But I have a question: Why we always set __GFP_HARDWALL when cpuset is
enabled, regardless of the value of cpuset.mem_hardwall?

There is no direct dependency between cpuset.mem_hardwall and the __GFP_HARDWALL flag. When cpuset is enabled, all user memory allocation should be subjected to the cpuset memory constraint. In the case of non-user memory allocation, it can fall back to to the node mask of an ancestor up to the root cgroup, i.e. all memory nodes. cpuset.mem_hardwall enables a barrier to this upward search.

Note that cpuset.mem_hardwall is a v1 feature that is not available in cgroup v2.

Cheers,
Longman