From: Dave Chinner <david@fromorbit.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: David Rientjes <rientjes@google.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [3.2-rc3] OOM killer doesn't kill the obvious memory hog
Date: Mon, 5 Dec 2011 09:04:36 +1100 [thread overview]
Message-ID: <20111204220436.GB7046@dastard> (raw)
In-Reply-To: <20111202144441.4c2ff29e.kamezawa.hiroyu@jp.fujitsu.com>
On Fri, Dec 02, 2011 at 02:44:41PM +0900, KAMEZAWA Hiroyuki wrote:
> On Fri, 2 Dec 2011 14:31:48 +1100
> Dave Chinner <david@fromorbit.com> wrote:
>
> > So, it's a distro bug - sshd should never be started from from udev
> > context because of this inherited oom_score_adj thing.
> > Interestingly, the ifup ssh restart script says this:
> >
> > # We'd like to use 'reload' here, but it has some problems; see #502444.
> > if [ -x /usr/sbin/invoke-rc.d ]; then
> > invoke-rc.d ssh restart >/dev/null 2>&1 || true
> > else
> > /etc/init.d/ssh restart >/dev/null 2>&1 || true
> > fi
> >
> > Bug 502444 describes the exact startup race condition that I've just
> > found. It does a ssh server restart because reload causes the sshd
> > server to fail to start if a start is currently in progress. So,
> > rather than solving the start vs reload race condition, it got a
> > bandaid (use restart to restart sshd from the reload context) and
> > left it as a landmine.....
> >
>
> Thank you for chasing.
> Hm, BTW, do you think this kind of tracepoint is useful for debugging ?
> This patch is just an example.
Definitely a good idea, because not all applications have logging
like sshd does. Besides, the first thing I went looking for was
tracepoints. ;)
>
> ==
> From ed565cbf842e0b30827fba7bfdbc724fe21d9d2d Mon Sep 17 00:00:00 2001
> From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Date: Fri, 2 Dec 2011 14:10:51 +0900
> Subject: [PATCH] oom_score_adj trace point.
>
> oom_score_adj is set by some daemon and launch tasks ans inherited
> to applications, sometimes unexpectedly.
>
> This patch is for debugging oom_score_adj inheritance. This
> adds trace points for oom_score_adj inheritance.
>
> bash-2501 [002] 448.860197: oom_score_adj_update: task 2501[bash] updates oom_score_adj=-1000
> bash-2501 [002] 455.678190: oom_score_adj_inherited: new task 2527 inherited oom_score_adj -1000
> ls-2527 [007] 455.678683: oom_score_task_rename: task 2527[bash] to [ls] oom_score_adj=-1000
> bash-2501 [007] 461.632103: oom_score_adj_inherited: new task 2528 inherited oom_score_adj -1000
> bash-2501 [007] 461.632335: oom_score_adj_inherited: new task 2529 inherited oom_score_adj -1000
> ls-2528 [003] 461.632983: oom_score_task_rename: task 2528[bash] to [ls] oom_score_adj=-1000
> less-2529 [005] 461.633086: oom_score_task_rename: task 2529[bash] to [less] oom_score_adj=-1000
> bash-2501 [004] 474.888710: oom_score_adj_update: task 2501[bash] updates oom_score_adj=0
>
> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Dave Chinner <dchinner@redhat.com>
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Dave Chinner <david@fromorbit.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: David Rientjes <rientjes@google.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [3.2-rc3] OOM killer doesn't kill the obvious memory hog
Date: Mon, 5 Dec 2011 09:04:36 +1100 [thread overview]
Message-ID: <20111204220436.GB7046@dastard> (raw)
In-Reply-To: <20111202144441.4c2ff29e.kamezawa.hiroyu@jp.fujitsu.com>
On Fri, Dec 02, 2011 at 02:44:41PM +0900, KAMEZAWA Hiroyuki wrote:
> On Fri, 2 Dec 2011 14:31:48 +1100
> Dave Chinner <david@fromorbit.com> wrote:
>
> > So, it's a distro bug - sshd should never be started from from udev
> > context because of this inherited oom_score_adj thing.
> > Interestingly, the ifup ssh restart script says this:
> >
> > # We'd like to use 'reload' here, but it has some problems; see #502444.
> > if [ -x /usr/sbin/invoke-rc.d ]; then
> > invoke-rc.d ssh restart >/dev/null 2>&1 || true
> > else
> > /etc/init.d/ssh restart >/dev/null 2>&1 || true
> > fi
> >
> > Bug 502444 describes the exact startup race condition that I've just
> > found. It does a ssh server restart because reload causes the sshd
> > server to fail to start if a start is currently in progress. So,
> > rather than solving the start vs reload race condition, it got a
> > bandaid (use restart to restart sshd from the reload context) and
> > left it as a landmine.....
> >
>
> Thank you for chasing.
> Hm, BTW, do you think this kind of tracepoint is useful for debugging ?
> This patch is just an example.
Definitely a good idea, because not all applications have logging
like sshd does. Besides, the first thing I went looking for was
tracepoints. ;)
>
> ==
> From ed565cbf842e0b30827fba7bfdbc724fe21d9d2d Mon Sep 17 00:00:00 2001
> From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Date: Fri, 2 Dec 2011 14:10:51 +0900
> Subject: [PATCH] oom_score_adj trace point.
>
> oom_score_adj is set by some daemon and launch tasks ans inherited
> to applications, sometimes unexpectedly.
>
> This patch is for debugging oom_score_adj inheritance. This
> adds trace points for oom_score_adj inheritance.
>
> bash-2501 [002] 448.860197: oom_score_adj_update: task 2501[bash] updates oom_score_adj=-1000
> bash-2501 [002] 455.678190: oom_score_adj_inherited: new task 2527 inherited oom_score_adj -1000
> ls-2527 [007] 455.678683: oom_score_task_rename: task 2527[bash] to [ls] oom_score_adj=-1000
> bash-2501 [007] 461.632103: oom_score_adj_inherited: new task 2528 inherited oom_score_adj -1000
> bash-2501 [007] 461.632335: oom_score_adj_inherited: new task 2529 inherited oom_score_adj -1000
> ls-2528 [003] 461.632983: oom_score_task_rename: task 2528[bash] to [ls] oom_score_adj=-1000
> less-2529 [005] 461.633086: oom_score_task_rename: task 2529[bash] to [less] oom_score_adj=-1000
> bash-2501 [004] 474.888710: oom_score_adj_update: task 2501[bash] updates oom_score_adj=0
>
> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Dave Chinner <dchinner@redhat.com>
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2011-12-04 22:04 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-01 9:36 [3.2-rc3] OOM killer doesn't kill the obvious memory hog Dave Chinner
2011-12-01 9:36 ` Dave Chinner
2011-12-01 9:50 ` KAMEZAWA Hiroyuki
2011-12-01 9:50 ` KAMEZAWA Hiroyuki
2011-12-01 12:46 ` Dave Chinner
2011-12-01 12:46 ` Dave Chinner
2011-12-01 22:35 ` David Rientjes
2011-12-01 22:35 ` David Rientjes
2011-12-02 1:59 ` Dave Chinner
2011-12-02 1:59 ` Dave Chinner
2011-12-02 3:31 ` Dave Chinner
2011-12-02 3:31 ` Dave Chinner
2011-12-02 5:44 ` KAMEZAWA Hiroyuki
2011-12-02 5:44 ` KAMEZAWA Hiroyuki
2011-12-04 22:04 ` Dave Chinner [this message]
2011-12-04 22:04 ` Dave Chinner
2011-12-06 20:31 ` David Rientjes
2011-12-06 20:31 ` David Rientjes
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=20111204220436.GB7046@dastard \
--to=david@fromorbit.com \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.