public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@debian.org>
To: linux-ia64@vger.kernel.org
Subject: Re: percpu data for non-existant cpus
Date: Tue, 04 Nov 2003 23:04:28 +0000	[thread overview]
Message-ID: <marc-linux-ia64-106798708313933@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-106790736528585@msgid-missing>

On Tue, Nov 04, 2003 at 10:43:49AM +0900, Takayoshi Kochi wrote:
> --- linux-2.6.0-test6.orig/arch/ia64/mm/tlb.c	Sun Sep 28 09:50:38 2003
> +++ linux-2.6.0-test6/arch/ia64/mm/tlb.c	Wed Oct  8 17:58:42 2003
> @@ -77,7 +77,7 @@
>  	{
>  		int cpu = get_cpu(); /* prevent preemption/migration */
>  		for (i = 0; i < NR_CPUS; ++i)
> -			if (i != cpu)
> +			if (cpu_online(i) && (i != cpu))
>  				per_cpu(ia64_need_tlb_flush, i) = 1;
>  		put_cpu();
>  	}

Surely this should rather be...

	{
		int cpu = get_cpu(); /* prevent preemption/migration */
-		for (i = 0; i < NR_CPUS; ++i)
+		for_each_cpu(i, cpu_online_map)
			if (i != cpu)
				per_cpu(ia64_need_tlb_flush, i) = 1;
		put_cpu();

I suppose one could create a new cpu_map based on cpu_online_map &~ cpu
but that feels rather more heavyweight than a test inside a loop.

-- 
"It's not Hollywood.  War is real, war is primarily not about defeat or
victory, it is about death.  I've seen thousands and thousands of dead bodies.
Do you think I want to have an academic debate on this subject?" -- Robert Fisk

      parent reply	other threads:[~2003-11-04 23:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-04  0:55 percpu data for non-existant cpus Jack Steiner
2003-11-04  1:43 ` Takayoshi Kochi
2003-11-04 23:04 ` Matthew Wilcox [this message]

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=marc-linux-ia64-106798708313933@msgid-missing \
    --to=willy@debian.org \
    --cc=linux-ia64@vger.kernel.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