All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <fweisbec@gmail.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Huang Ying <ying.huang@intel.com>, Ingo Molnar <mingo@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>, LKP ML <lkp@01.org>
Subject: Re: [LKP] [sched] BUG: kernel boot hang
Date: Mon, 16 Feb 2015 19:22:38 +0100	[thread overview]
Message-ID: <20150216182235.GA20614@lerouge> (raw)
In-Reply-To: <20150216150733.GD5029@twins.programming.kicks-ass.net>

On Mon, Feb 16, 2015 at 04:07:33PM +0100, Peter Zijlstra wrote:
> On Sun, Feb 15, 2015 at 01:18:07PM -0500, Steven Rostedt wrote:
> > On Sun, 15 Feb 2015 16:46:22 +0100
> > Frederic Weisbecker <fweisbec@gmail.com> wrote:
> > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> > > index c017a5f..a6d4d6c 100644
> > > --- a/kernel/sched/core.c
> > > +++ b/kernel/sched/core.c
> > > @@ -2879,7 +2879,7 @@ void __sched schedule_preempt_disabled(void)
> > >  	preempt_disable();
> > >  }
> > >  
> > > -static void preempt_schedule_common(void)
> > > +static void __sched notrace preempt_schedule_common(void)
> > >  {
> > >  	do {
> > >  		preempt_count_add(PREEMPT_ACTIVE);
> > 
> > Ah, since I added better recursion protection code in function tracer
> > this didn't break that. But unfortunately, function graph tracer
> > doesn't have that protection.
> > 
> > If it traces between preempt_schedule() and where it sets
> > PREEMPT_ACTIVE, it can indeed go into an infinite recursion. Yeah,
> > preempt_schedule_common() should be notrace, at least until we change
> > function_graph to have that recursion protection.
> > 
> > Acked-by: Steven Rostedt <rostedt@goodmis.org>
> 
> 
> Can someone shoot me a proper patch with Changelog and such?

Sure, I just sent it as: "[PATCH] sched: Fix preempt_schedule_common() triggering tracing recursion"

Huang Ying hasn't yet reported a Tested-by but I could reproduce (with both function and function_graph tracers btw)
and the patch fixed it.

Thanks.

WARNING: multiple messages have this Message-ID (diff)
From: Frederic Weisbecker <fweisbec@gmail.com>
To: lkp@lists.01.org
Subject: Re: [sched] BUG: kernel boot hang
Date: Mon, 16 Feb 2015 19:22:38 +0100	[thread overview]
Message-ID: <20150216182235.GA20614@lerouge> (raw)
In-Reply-To: <20150216150733.GD5029@twins.programming.kicks-ass.net>

[-- Attachment #1: Type: text/plain, Size: 1543 bytes --]

On Mon, Feb 16, 2015 at 04:07:33PM +0100, Peter Zijlstra wrote:
> On Sun, Feb 15, 2015 at 01:18:07PM -0500, Steven Rostedt wrote:
> > On Sun, 15 Feb 2015 16:46:22 +0100
> > Frederic Weisbecker <fweisbec@gmail.com> wrote:
> > > diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> > > index c017a5f..a6d4d6c 100644
> > > --- a/kernel/sched/core.c
> > > +++ b/kernel/sched/core.c
> > > @@ -2879,7 +2879,7 @@ void __sched schedule_preempt_disabled(void)
> > >  	preempt_disable();
> > >  }
> > >  
> > > -static void preempt_schedule_common(void)
> > > +static void __sched notrace preempt_schedule_common(void)
> > >  {
> > >  	do {
> > >  		preempt_count_add(PREEMPT_ACTIVE);
> > 
> > Ah, since I added better recursion protection code in function tracer
> > this didn't break that. But unfortunately, function graph tracer
> > doesn't have that protection.
> > 
> > If it traces between preempt_schedule() and where it sets
> > PREEMPT_ACTIVE, it can indeed go into an infinite recursion. Yeah,
> > preempt_schedule_common() should be notrace, at least until we change
> > function_graph to have that recursion protection.
> > 
> > Acked-by: Steven Rostedt <rostedt@goodmis.org>
> 
> 
> Can someone shoot me a proper patch with Changelog and such?

Sure, I just sent it as: "[PATCH] sched: Fix preempt_schedule_common() triggering tracing recursion"

Huang Ying hasn't yet reported a Tested-by but I could reproduce (with both function and function_graph tracers btw)
and the patch fixed it.

Thanks.

  reply	other threads:[~2015-02-16 18:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-15  7:43 [LKP] [sched] BUG: kernel boot hang Huang Ying
2015-02-15  7:43 ` Huang Ying
2015-02-15 15:31 ` [LKP] " Frederic Weisbecker
2015-02-15 15:31   ` Frederic Weisbecker
2015-02-15 15:38 ` [LKP] " Frederic Weisbecker
2015-02-15 15:38   ` Frederic Weisbecker
2015-02-15 15:46 ` [LKP] " Frederic Weisbecker
2015-02-15 15:46   ` Frederic Weisbecker
2015-02-15 18:18   ` [LKP] " Steven Rostedt
2015-02-15 18:18     ` Steven Rostedt
2015-02-16 15:07     ` [LKP] " Peter Zijlstra
2015-02-16 15:07       ` Peter Zijlstra
2015-02-16 18:22       ` Frederic Weisbecker [this message]
2015-02-16 18:22         ` Frederic Weisbecker
2015-02-16 18:34         ` [LKP] " Steven Rostedt
2015-02-16 18:34           ` Steven Rostedt

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=20150216182235.GA20614@lerouge \
    --to=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@01.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=ying.huang@intel.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.