Re: [PATCH 2/4] oom: Do not invoke oom notifiers on sysrq+f

From: Michal Hocko
Date: Fri Jul 10 2015 - 03:40:48 EST


On Thu 09-07-15 14:07:37, David Rientjes wrote:
> On Thu, 9 Jul 2015, Michal Hocko wrote:
[...]
> > So I am not
> > sure it belongs outside of the oom killer proper.
> >
>
> Umm it has nothing to do with oom killing, it quite obviously doesn't
> belong in the oom killer.

The naming of the API would disagree. To me register_oom_notifier sounds
like a mechanism to be notified when we are oom.

> It belongs prior to invoking the oom killer if memory could be freed.

Shrinkers are there to reclaim and prevent from OOM. This API is a gray
zone. It looks generic method for the notification yet it allows to
prevent from oom killer. I can imagine somebody might abuse this
interface to implement OOM killer policies.

Anyway, I think it would be preferable to kill it altogether rather than
play with its placing. It will always be a questionable API.

[...]
--
Michal Hocko
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/