All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joe Thornber <thornber@redhat.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: device-mapper development <dm-devel@redhat.com>
Subject: Re: [PATCH] dm-block-manager: use spinlocks that don't disable interrupts
Date: Mon, 12 Sep 2011 15:11:00 +0100	[thread overview]
Message-ID: <20110912141059.GD14861@ubuntu> (raw)
In-Reply-To: <20110912135742.GA23492@infradead.org>

On Mon, Sep 12, 2011 at 09:57:42AM -0400, Christoph Hellwig wrote:
> On Mon, Sep 12, 2011 at 07:24:48AM -0400, Mikulas Patocka wrote:
> > dm-block-manager: use spinlocks that don't disable interrupts
> > 
> > This will never be called in an interrupt context, so we don't have to use
> > spinlocks that disable interrupts.
> 
> The code looks like a re-implementation of rw_semaphores to me.
> 
> Is there any good reason to do this? (hint: normally there isn't :))

Yes, largely it is.  The major difference is it errors on recursive
use (which can occur due to malicious metadata as well as programming
errors).  This is far better than deadlocking (which rwsemaphores to),
livelocking (which no-locking may do), or not noticing something's
wrong (which no-locking may do).

I can understand that people may well want to turn locking off to get
the better performance.  So there's a Kconfig option for this.

- Joe

      reply	other threads:[~2011-09-12 14:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-12 11:24 [PATCH] dm-block-manager: use spinlocks that don't disable interrupts Mikulas Patocka
2011-09-12 13:52 ` Joe Thornber
2011-09-12 13:57 ` Christoph Hellwig
2011-09-12 14:11   ` Joe Thornber [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=20110912141059.GD14861@ubuntu \
    --to=thornber@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=hch@infradead.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 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.