All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@steeleye.com>
To: Rusty Russell <rusty@rustcorp.com.au>
Cc: James Bottomley <James.Bottomley@SteelEye.com>,
	linux-kernel@vger.kernel.org, mingo@redhat.com
Subject: Re: Optimisation for smp_num_cpus loop in hotplug
Date: Fri, 21 Jun 2002 11:31:44 -0400	[thread overview]
Message-ID: <200206211531.g5LFViZ07396@localhost.localdomain> (raw)
In-Reply-To: Message from Rusty Russell <rusty@rustcorp.com.au>  of "Sat, 22 Jun 2002 01:14:46 +1000." <E17LQ7b-0000Iz-00@wagner.rustcorp.com.au>

rusty@rustcorp.com.au said:
> Yeah, it's simple, and none of the current ones are really critical.
> But I think we're better off with:
> 	for (i = first_cpu(); i < NR_CPUS; i = next_cpu(i)) {

> Which is simple enough not to need an iterator macro, and also has the
> bonus of giving irq-balancing et al. an efficient, portable way of
> looking for the "next" cpu. 

So you're thinking that next_cpu(i) is something like

__ffs((~(unsigned)((1<<i)-1) & cpu_online_map)

plus an extra exception piece to take next_cpu(i) above NR_CPUS if we have no 
remaining CPUs (because __ffs would be undefined)?  It's the exception piece 
that I don't see how to do really efficiently.

James



  reply	other threads:[~2002-06-21 15:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-20 23:41 Optimisation for smp_num_cpus loop in hotplug James Bottomley
2002-06-21 15:14 ` Rusty Russell
2002-06-21 15:31   ` James Bottomley [this message]
2002-06-21 19:17     ` Rusty Russell
     [not found] <mailman.1024617156.25656.linux-kernel2news@redhat.com>
2002-06-21  4:16 ` Pete Zaitcev
2002-06-21 13:10   ` James Bottomley

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=200206211531.g5LFViZ07396@localhost.localdomain \
    --to=james.bottomley@steeleye.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rusty@rustcorp.com.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 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.