public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: Jeff Garzik <garzik@havoc.gtf.org>
Cc: Andrew Morton <akpm@zip.com.au>, Bob Miller <rem@osdl.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 2.5.3 remove global semaphore_lock spin lock.
Date: Fri, 1 Feb 2002 16:58:46 +0100	[thread overview]
Message-ID: <20020201165846.I12156@suse.de> (raw)
In-Reply-To: <20020131150139.A1345@doc.pdx.osdl.net> <3C59D956.4F2B85DB@zip.com.au> <20020131224117.E21864@havoc.gtf.org>
In-Reply-To: <20020131224117.E21864@havoc.gtf.org>

On Thu, Jan 31 2002, Jeff Garzik wrote:
> On Thu, Jan 31, 2002 at 03:55:02PM -0800, Andrew Morton wrote:
> > > +       unsigned long flags;
> > > +       wq_write_lock_irqsave(&sem->wait.lock, flags);
> > > -       spin_lock_irq(&semaphore_lock);
> > 
> > I rather dislike spin_lock_irq(), because it's fragile (makes
> 
> It's less flexible for architectures, too.
> 
> spin_lock_irqsave is considered 100% portable AFAIK, and I make it my
> own policy to s/_irq/_irqsave/ when the opportunity strikes in my PCI
> drivers.

spin_lock_irq is cheaper, though, and sometimes you _know_ it's safe to
use. For instance, if the function in question can block (ie never
called with interrupts disabled) then using spin_lock_irq is always
safe.

I've heard this portability argument before, anyone care to outline
_what_ the problem allegedly is?? Major part of the kernel uses
spin_lock_irq and I suspect we would be seeing lots of request list
corruption did it not work.

-- 
Jens Axboe


  reply	other threads:[~2002-02-01 15:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-31 23:01 [PATCH] 2.5.3 remove global semaphore_lock spin lock Bob Miller
2002-01-31 23:55 ` Andrew Morton
2002-02-01  3:41   ` Jeff Garzik
2002-02-01 15:58     ` Jens Axboe [this message]
2002-02-01 20:52   ` Bob Miller
2002-02-01 21:05     ` Andrew Morton
2002-02-01 22:45       ` Bob Miller

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=20020201165846.I12156@suse.de \
    --to=axboe@suse.de \
    --cc=akpm@zip.com.au \
    --cc=garzik@havoc.gtf.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rem@osdl.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