public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Sasha Levin <levinsasha928@gmail.com>,
	Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
	"linux-kernel@vger.kernel.org List"
	<linux-kernel@vger.kernel.org>, Dave Jones <davej@redhat.com>,
	mingo@kernel.org, "Liu, Chuansheng" <chuansheng.liu@intel.com>,
	vapier@gentoo.org, rusty@rustcorp.com.au
Subject: Re: sched: WARNING: at include/linux/cpumask.h:108 select_fallback_rq+0x241/0x280()
Date: Sat, 31 Mar 2012 13:22:25 +0530	[thread overview]
Message-ID: <4F76B7B9.5080709@linux.vnet.ibm.com> (raw)
In-Reply-To: <1333118719.2960.27.camel@laptop>

On 03/30/2012 08:15 PM, Peter Zijlstra wrote:

> On Fri, 2012-03-30 at 19:40 +0530, Srivatsa S. Bhat wrote:
> 
>> From: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
>> Subject: sched: Fix incorrect usage of for_each_cpu_mask() in select_fallback_rq()
>>
>> The function for_each_cpu_mask() expects a *pointer* to struct cpumask
>> as its second argument, whereas select_fallback_rq() passes the value
>> itself. And moreover, for_each_cpu_mask() has been marked as obselete
>> in include/linux/cpumask.h. So move to the more appropriate for_each_cpu()
>> variant.
> 
> Gah.. so why did it compile to begin with!?


One of the perils of using macros instead of true function calls :-(


Regards,
Srivatsa S. Bhat

> 
>> Reported-by: Sasha Levin <levinsasha928@gmail.com>
>> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
>> Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
>> ---
>>
>>  kernel/sched/core.c |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
>> index e3ed0ec..e85046d 100644
>> --- a/kernel/sched/core.c
>> +++ b/kernel/sched/core.c
>> @@ -1270,7 +1270,7 @@ static int select_fallback_rq(int cpu, struct task_struct *p)
>>  	int dest_cpu;
>>  
>>  	/* Look for allowed, online CPU in same node. */
>> -	for_each_cpu_mask(dest_cpu, *nodemask) {
>> +	for_each_cpu(dest_cpu, nodemask) {
>>  		if (!cpu_online(dest_cpu))
>>  			continue;
>>  		if (!cpu_active(dest_cpu))
>> @@ -1281,7 +1281,7 @@ static int select_fallback_rq(int cpu, struct task_struct *p)
>>  
>>  	for (;;) {
>>  		/* Any allowed, online CPU? */
>> -		for_each_cpu_mask(dest_cpu, *tsk_cpus_allowed(p)) {
>> +		for_each_cpu(dest_cpu, tsk_cpus_allowed(p)) {
>>  			if (!cpu_online(dest_cpu))
>>  				continue;
>>  			if (!cpu_active(dest_cpu))
>>
>>
> 
> 
> 


  reply	other threads:[~2012-03-31  7:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CA+1xoqcf6qJOouKXGEHsjWSBJdA7qtMnuVopq+hoHS+TX8fvSg@mail.gmail.com>
2012-03-29 20:32 ` sched: WARNING: at include/linux/cpumask.h:108 select_fallback_rq+0x241/0x280() Sasha Levin
2012-03-30 14:10   ` Srivatsa S. Bhat
2012-03-30 14:45     ` Peter Zijlstra
2012-03-31  7:52       ` Srivatsa S. Bhat [this message]
2012-04-14  9:17         ` Peter Zijlstra
2012-04-14 11:40           ` Sasha Levin
2012-04-14 18:12             ` Peter Zijlstra
2012-04-14 18:37               ` Sasha Levin
2012-03-30 15:00     ` Sasha Levin
2012-03-31  9:46     ` [tip:sched/urgent] sched: Fix incorrect usage of for_each_cpu_mask () in select_fallback_rq() tip-bot for Srivatsa S. Bhat

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=4F76B7B9.5080709@linux.vnet.ibm.com \
    --to=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=chuansheng.liu@intel.com \
    --cc=davej@redhat.com \
    --cc=levinsasha928@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rusty@rustcorp.com.au \
    --cc=tglx@linutronix.de \
    --cc=vapier@gentoo.org \
    /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