* [PATCH v3] mm, oom: OOM sysrq should always kill a process
@ 2022-01-06 10:26 Jann Horn
2022-01-06 20:34 ` David Rientjes
0 siblings, 1 reply; 2+ messages in thread
From: Jann Horn @ 2022-01-06 10:26 UTC (permalink / raw)
To: Andrew Morton, linux-mm; +Cc: linux-kernel, Jann Horn, Michal Hocko
The OOM kill sysrq (alt+sysrq+F) should allow the user to kill the
process with the highest OOM badness with a single execution.
However, at the moment, the OOM kill can bail out if an OOM notifier
(e.g. the i915 one) says that it reclaimed a tiny amount of memory
from somewhere. That's probably not what the user wants, so skip the
bailout if the OOM was triggered via sysrq.
Acked-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Jann Horn <jannh@google.com>
---
mm/oom_kill.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/oom_kill.c b/mm/oom_kill.c
index 1ddabefcfb5a..3c480b24a93c 100644
--- a/mm/oom_kill.c
+++ b/mm/oom_kill.c
@@ -1057,7 +1057,7 @@ bool out_of_memory(struct oom_control *oc)
if (!is_memcg_oom(oc)) {
blocking_notifier_call_chain(&oom_notify_list, 0, &freed);
- if (freed > 0)
+ if (freed > 0 && !is_sysrq_oom(oc))
/* Got some memory back in the last second. */
return true;
}
base-commit: c9e6606c7fe92b50a02ce51dda82586ebdf99b48
--
2.34.1.448.ga2b2bfdf31-goog
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v3] mm, oom: OOM sysrq should always kill a process
2022-01-06 10:26 [PATCH v3] mm, oom: OOM sysrq should always kill a process Jann Horn
@ 2022-01-06 20:34 ` David Rientjes
0 siblings, 0 replies; 2+ messages in thread
From: David Rientjes @ 2022-01-06 20:34 UTC (permalink / raw)
To: Jann Horn; +Cc: Andrew Morton, linux-mm, linux-kernel, Michal Hocko
On Thu, 6 Jan 2022, Jann Horn wrote:
> The OOM kill sysrq (alt+sysrq+F) should allow the user to kill the
> process with the highest OOM badness with a single execution.
>
> However, at the moment, the OOM kill can bail out if an OOM notifier
> (e.g. the i915 one) says that it reclaimed a tiny amount of memory
> from somewhere. That's probably not what the user wants, so skip the
> bailout if the OOM was triggered via sysrq.
>
> Acked-by: Michal Hocko <mhocko@suse.com>
> Signed-off-by: Jann Horn <jannh@google.com>
Acked-by: David Rientjes <rientjes@google.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-01-06 20:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-06 10:26 [PATCH v3] mm, oom: OOM sysrq should always kill a process Jann Horn
2022-01-06 20:34 ` David Rientjes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox