public inbox for linux-next@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: ego@in.ibm.com
Cc: Sachin Sant <sachinp@in.ibm.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>,
	linux-next@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	Mike Galbraith <efault@gmx.de>
Subject: Re: -next: Nov 12 - kernel BUG at kernel/sched.c:7359!
Date: Fri, 13 Nov 2009 11:16:08 +0100	[thread overview]
Message-ID: <1258107368.4039.1149.camel@laptop> (raw)
In-Reply-To: <20091113095801.GA29977@in.ibm.com>

On Fri, 2009-11-13 at 15:28 +0530, Gautham R Shenoy wrote:
> On Thu, Nov 12, 2009 at 06:10:31PM +0100, Peter Zijlstra wrote:
> > 
> > diff --git a/kernel/sched.c b/kernel/sched.c
> > index 1f2e99d..62df61c 100644
> > --- a/kernel/sched.c
> > +++ b/kernel/sched.c
> > @@ -2377,6 +2377,9 @@ static int try_to_wake_up(struct task_struct *p, unsigned int state,
> >  	task_rq_unlock(rq, &flags);
> > 
> 
> How about this ?
> 
> again:
>   	cpu = p->sched_class->select_task_rq(p, SD_BALANCE_WAKE, wake_flags);
>  	if (!cpu_online(cpu))
>  		cpu = cpumask_any_and(&p->cpus_allowed, cpu_active_mask);
> 	if (!cpu) {
> 		set_task_affinity(); 
> 		goto again;
> 	}
> > +
> >  	if (cpu != orig_cpu) {
> >  		local_irq_save(flags);
> >  		rq = cpu_rq(cpu);

Index: linux-2.6/kernel/sched.c
===================================================================
--- linux-2.6.orig/kernel/sched.c
+++ linux-2.6/kernel/sched.c
@@ -2376,7 +2376,15 @@ static int try_to_wake_up(struct task_st
 	p->state = TASK_WAKING;
 	__task_rq_unlock(rq);
 
+again:
 	cpu = p->sched_class->select_task_rq(p, SD_BALANCE_WAKE, wake_flags);
+	if (!cpu_online(cpu))
+		cpu = cpumask_any_and(&p->cpus_allowed, cpu_online_mask);
+	if (cpu >= nr_cpu_ids) {
+		cpuset_cpus_allowed_locked(p, &p->cpus_allowed);
+		goto again;
+	}
+
 	if (cpu != orig_cpu) {
 		rq = cpu_rq(cpu);
 		update_rq_clock(rq);

is what I stuck in and am compiling now.. we'll see what that does.

  reply	other threads:[~2009-11-13 10:16 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-12  8:51 linux-next: Tree for November 12 Stephen Rothwell
2009-11-12 11:53 ` -next: Nov 12 - kernel BUG at kernel/sched.c:7359! Sachin Sant
2009-11-12 12:10   ` Peter Zijlstra
2009-11-12 12:23     ` Sachin Sant
2009-11-12 12:27       ` Peter Zijlstra
2009-11-12 17:10         ` Peter Zijlstra
2009-11-13  9:00           ` Sachin Sant
2009-11-13  9:06             ` Peter Zijlstra
2009-11-13  9:58           ` Gautham R Shenoy
2009-11-13 10:16             ` Peter Zijlstra [this message]
2009-11-13 10:31               ` Peter Zijlstra
2009-11-13 10:49                 ` Peter Zijlstra
2009-11-13 11:44                 ` Sachin Sant
2009-11-13 16:12                 ` Mike Galbraith
2009-11-23  9:53                 ` Sachin Sant
2009-11-25 13:42                   ` Peter Zijlstra
2009-11-26  4:39                     ` Sachin Sant
2009-12-04 12:06                     ` Sachin Sant
2009-12-04 12:16                       ` Peter Zijlstra
2009-12-07  6:16                         ` Sachin Sant
2009-12-12  7:09                     ` Max Krasnyansky
2009-11-12 17:40 ` linux-next: Tree for November 12 (acpi/processor.h) Randy Dunlap
2009-11-12 18:09   ` linux-next: Tree for November 12 (acpi_processor_get_bios_limit) Randy Dunlap
2009-11-12 23:46 ` [PATCH -next] staging/line6: fix printk formats Randy Dunlap

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=1258107368.4039.1149.camel@laptop \
    --to=peterz@infradead.org \
    --cc=efault@gmx.de \
    --cc=ego@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=sachinp@in.ibm.com \
    --cc=sfr@canb.auug.org.au \
    /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