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

From: Gang Li
Date: Thu Apr 06 2023 - 09:02:27 EST


On 2023/4/5 01:24, Waiman Long wrote:

You will also need to take cpuset_rwsem to make sure that cpusets are stable. BTW, the cpuset_cgroup_scan_tasks() name is kind of redundant. I will suggest you just name it as cpuset_scan_tasks(). Please also add a

mem cgroup oom use `mem_cgroup_scan_tasks`.
How about keep `cpuset_cgroup_scan_tasks` for naming consistency?

```
static void select_bad_process(struct oom_control *oc)
{
oc->chosen_points = LONG_MIN;

if (is_memcg_oom(oc))
mem_cgroup_scan_tasks(oc->memcg, oom_evaluate_task, oc);
else if (oc->constraint == CONSTRAINT_CPUSET)
cpuset_cgroup_scan_tasks(oom_evaluate_task, oc);
else {
...
}
}
```