On Wed, 21 Sep 2022, Gang Li wrote:Hi,
cpuset confine processes to processor and memory node subsets.
When a process in cpuset triggers oom, it may kill a completely
irrelevant process on another numa node, which will not release any
memory for this cpuset.
It seems that `CONSTRAINT_CPUSET` is not really doing much these
days. Using CONSTRAINT_CPUSET, we can easily achieve node aware oom
killing by selecting victim from the cpuset which triggers oom.
Suggested-by: Michal Hocko <mhocko@xxxxxxxx>
Signed-off-by: Gang Li <ligang.bdlg@xxxxxxxxxxxxx>
Hmm, is this the right approach?
If a cpuset results in a oom condition, is there a reason why we'd need to
find a process from within that cpuset to kill? I think the idea is to
free memory on the oom set of nodes (cpuset.mems) and that can happen by
killing a process that is not a member of this cpuset.
I understand the challenges of creating a NUMA aware oom killer to target
memory that is actually resident on an oom node, but this approach doesn't
seem right and could actually lead to pathological cases where a small
process trying to fork in an otherwise empty cpuset is repeatedly oom
killing when we'd actually prefer to kill a single large process.