Re: [PATCH v2 1/2] mm, memcg: rename mem_cgroup_out_of_memory()

Chris Down
2020-05-04T15:50:48Z

Yafang Shao writes:
>Rename mem_cgroup_out_of_memory() to mem_cgroup_oom_kill() to indicate
>that this function is used to try to kill a process.
>With this change it will cooperate better with the oom events.
> function memcg event
> mem_cgroup_oom() oom
> mem_cgroup_oom_kill() oom_kill

Hmm. The reason it's called mem_cgroup_out_of_memory() is, as Michal said, to
match out_of_memory, which may or may not OOM kill. Internally,
mem_cgroup_out_of_memory() may also do this depending on the state of oom_lock
and the current task, so mem_cgroup_out_of_memory() is really about *deciding*
what to do when generically out of memory rather than necessarily OOM killing
something (although yes, that's the general outcome).

Is matching the memcg event names the only reason you'd like to do this, or are
there more concerns you had? If that's the only case, I think let's keep it as
is for now. :-)