All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Lee Revell <rlrevell@joe-job.com>
Cc: Zwane Mwaikambo <zwane@linuxpower.ca>,
	Dominik Brodowski <linux@dominikbrodowski.de>,
	lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] [CPU-HOTPLUG] convert cpucontrol to be a rwsem
Date: Tue, 02 Nov 2004 10:48:23 +1100	[thread overview]
Message-ID: <1099352903.20402.2.camel@localhost.localdomain> (raw)
In-Reply-To: <1099332277.3647.43.camel@krustophenia.net>

On Mon, 2004-11-01 at 13:04 -0500, Lee Revell wrote:
> On Mon, 2004-11-01 at 07:00 -0700, Zwane Mwaikambo wrote:
> > Agreed it makes a lot more sense, i think there could be some places where 
> > we use preempt_disable to protect against cpu offline which could 
> > converted, but that can come later.
> > 
> 
> You know I picked up Robert Love's book the other day and was surprised
> to read we are not supposed to be using preempt_disable, there is a
> per_cpu interface for exactly this kind of thing.  Which is currently
> recommended?

get_cpu() both ensures that this CPU won't go down, and ensures we won't
get scheduled off it.  It returns the current processor ID, as well.
put_cpu() puts the CPU back.

In my experience it's usually clearer than preempt_disable().

Cheers,
Rusty.
-- 
A bad analogy is like a leaky screwdriver -- Richard Braakman


  reply	other threads:[~2004-11-02  9:41 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-01  8:43 [PATCH] [CPU-HOTPLUG] convert cpucontrol to be a rwsem Dominik Brodowski
2004-11-01  9:05 ` Nick Piggin
2004-11-01 14:00 ` Zwane Mwaikambo
2004-11-01 18:04   ` Lee Revell
2004-11-01 23:48     ` Rusty Russell [this message]
2004-11-02 14:54       ` Lee Revell
2004-11-02  0:16     ` Zwane Mwaikambo
2004-11-02 22:28   ` Dominik Brodowski
2004-11-04  1:57     ` 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=1099352903.20402.2.camel@localhost.localdomain \
    --to=rusty@rustcorp.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@dominikbrodowski.de \
    --cc=rlrevell@joe-job.com \
    --cc=zwane@linuxpower.ca \
    /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.