All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Ralf Baechle <ralf@linux-mips.org>,
	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org,
	Venkatesh Pallipadi <venki@google.com>,
	"akpm\@linux-foundation.org" <akpm@linux-foundation.org>
Subject: Re: [PATCH 4/12] arch/mips: remove references to cpu_*_map.
Date: Thu, 16 Feb 2012 10:29:24 +1030	[thread overview]
Message-ID: <87hayrbqcj.fsf@rustcorp.com.au> (raw)
In-Reply-To: <4F3B78C2.7040709@linux.vnet.ibm.com>

On Wed, 15 Feb 2012 14:50:02 +0530, "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com> wrote:
> > -		cpu_clear(smp_processor_id(), mask);
> > -		for_each_cpu_mask(cpu, mask)
> > -			if (cpu_context(cpu, mm))
> > +		for_each_online_cpu(cpu) {
> > +			if (cpu != smp_processor_id() && cpu_context(cpu, mm))
> >  				cpu_context(cpu, mm) = 0;
> > +		}
> 
> 
> Strictly speaking, this one is not a mere cleanup. It causes a subtle change in
> behaviour: earlier, it used to iterate over a local copy of cpu_online_mask, which
> wouldn't change. However, with this patch, it will iterate directly over
> cpu_online_mask, which can change underneath. (The preempt_disable() won't stop
> new CPUs from coming in.. it only prevents CPUs from going offline, that too
> provided that we use stop_machine stuff for CPU offline, which we do currently.)

There's a preempt_disable() around this whole function, so online_mask
can't change.

Same with the others.
> > +		mask = *cpu_online_mask;
> > +	cpumask_clear(&mask, cpu);
> 
> 
> This should be cpumask_clear_cpu(cpu, &mask);

Good catch.  I copied the bitmask ops, and continually regret it.

I've rolled all these together with your fixes, added your ia64 patch,
and am rebasing to -next now, so I can hand this all across to akpm.

Thanks,
Rusty.

WARNING: multiple messages have this Message-ID (diff)
From: Rusty Russell <rusty@rustcorp.com.au>
To: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
Cc: Ralf Baechle <ralf@linux-mips.org>,
	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org,
	Venkatesh Pallipadi <venki@google.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>
Subject: Re: [PATCH 4/12] arch/mips: remove references to cpu_*_map.
Date: Thu, 16 Feb 2012 10:29:24 +1030	[thread overview]
Message-ID: <87hayrbqcj.fsf@rustcorp.com.au> (raw)
Message-ID: <20120215235924.VAwRipYT4w1Wu_ULaxBnsr0Mot3QEvDIdMfzOqawsP0@z> (raw)
In-Reply-To: <4F3B78C2.7040709@linux.vnet.ibm.com>

On Wed, 15 Feb 2012 14:50:02 +0530, "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com> wrote:
> > -		cpu_clear(smp_processor_id(), mask);
> > -		for_each_cpu_mask(cpu, mask)
> > -			if (cpu_context(cpu, mm))
> > +		for_each_online_cpu(cpu) {
> > +			if (cpu != smp_processor_id() && cpu_context(cpu, mm))
> >  				cpu_context(cpu, mm) = 0;
> > +		}
> 
> 
> Strictly speaking, this one is not a mere cleanup. It causes a subtle change in
> behaviour: earlier, it used to iterate over a local copy of cpu_online_mask, which
> wouldn't change. However, with this patch, it will iterate directly over
> cpu_online_mask, which can change underneath. (The preempt_disable() won't stop
> new CPUs from coming in.. it only prevents CPUs from going offline, that too
> provided that we use stop_machine stuff for CPU offline, which we do currently.)

There's a preempt_disable() around this whole function, so online_mask
can't change.

Same with the others.
> > +		mask = *cpu_online_mask;
> > +	cpumask_clear(&mask, cpu);
> 
> 
> This should be cpumask_clear_cpu(cpu, &mask);

Good catch.  I copied the bitmask ops, and continually regret it.

I've rolled all these together with your fixes, added your ia64 patch,
and am rebasing to -next now, so I can hand this all across to akpm.

Thanks,
Rusty.

  reply	other threads:[~2012-02-16  1:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-15  4:58 [PATCH 4/12] arch/mips: remove references to cpu_*_map Rusty Russell
2012-02-15  9:20 ` Srivatsa S. Bhat
2012-02-15 23:59   ` Rusty Russell [this message]
2012-02-15 23:59     ` Rusty Russell

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=87hayrbqcj.fsf@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=venki@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.