From: Michal Hocko <mhocko@kernel.org>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: rientjes@google.com, hannes@cmpxchg.org, linux-mm@kvack.org
Subject: Re: [PATCH] mm, oom: Disable preemption during OOM-kill operation.
Date: Tue, 22 Sep 2015 18:55:23 +0200 [thread overview]
Message-ID: <20150922165523.GD4027@dhcp22.suse.cz> (raw)
In-Reply-To: <201509191605.CAF13520.QVSFHLtFJOMOOF@I-love.SAKURA.ne.jp>
On Sat 19-09-15 16:05:12, Tetsuo Handa wrote:
> Well, this seems to be a problem which prevents me from testing various
> patches that tries to address OOM livelock problem.
>
> ---------- rcu-stall.c start ----------
> #define _GNU_SOURCE
> #include <stdio.h>
> #include <stdlib.h>
> #include <unistd.h>
> #include <sys/types.h>
> #include <sys/stat.h>
> #include <fcntl.h>
> #include <sched.h>
>
> static int dummy(void *fd)
> {
> char c;
> /* Wait until the first child thread is killed by the OOM killer. */
> read(* (int *) fd, &c, 1);
> /* Try to consume as much CPU time as possible via preemption. */
> while (1);
You would kill the system by this alone. Having 1000 busy loops just
kills your machine from doing anything useful and you are basically
DoS-ed. I am not sure sprinkling preempt_{enable,disable} all around the
oom path makes much difference. If anything having a kernel high
priority kernel thread sounds like a better approach.
[...]
> for (i = 0; i < 1000; i++) {
> clone(dummy, malloc(1024) + 1024, CLONE_SIGHAND | CLONE_VM,
> &pipe_fd[0]);
> if (!i)
> close(pipe_fd[1]);
--
Michal Hocko
SUSE Labs
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2015-09-22 16:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-19 7:05 Tetsuo Handa
2015-09-22 16:55 ` Michal Hocko [this message]
2015-09-23 14:26 ` Tetsuo Handa
2015-09-23 20:23 ` Michal Hocko
2015-09-27 5:51 ` Tetsuo Handa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150922165523.GD4027@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=linux-mm@kvack.org \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=rientjes@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox