All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <jens.axboe@oracle.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Neil Brown <neilb@suse.de>, Arthur Jones <ajones@riverbed.com>,
	Dan Williams <dan.j.williams@intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-raid@vger.kernel.org, "Rafael J. Wysocki" <rjw@sisk.pl>
Subject: Re: [PULL REQUEST] md bug fixes and minor improvements
Date: Fri, 1 Aug 2008 20:22:27 +0200	[thread overview]
Message-ID: <20080801182227.GI20055@kernel.dk> (raw)
In-Reply-To: <alpine.LFD.1.10.0808011115050.3277@nehalem.linux-foundation.org>

On Fri, Aug 01 2008, Linus Torvalds wrote:
> 
> 
> On Fri, 1 Aug 2008, Jens Axboe wrote:
> > +			spin_lock_irq(&bitmap->mddev->queue->queue_lock);
> >  			blk_plug_device(bitmap->mddev->queue);
> > +			spin_unlock_irq(&bitmap->mddev->queue->queue_lock);
> 
> Can we please not have a chain of three dereferences in a row like that? 
> That's an almost certain sign that we should either have a helper function 
> or just a variable, and do it as
> 
> 	queue = bitmap->mddev->queue;
> 
> 	spin_lock_irq(&queue->queue_lock);
> 	blk_plug_device(queue);
> 	spin_unlock_irq(&queue->queue_lock);
> 
> Hmm? Perhaps the helper function is cleaner, ie
> 
> 	static inline blk_plug_device_unlocked(struct request_queue * queue)
> 	{..
> 
> instead. That, of course, would have to use spin_lock_irqsave().

I rather like that. I've got a few simpler things to push, I'll queue it
up with that and send you a pull request later today.

-- 
Jens Axboe


      reply	other threads:[~2008-08-01 18:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-01  3:02 [PULL REQUEST] md bug fixes and minor improvements Neil Brown
2008-08-01  3:02 ` Neil Brown
2008-08-01 17:16 ` Linus Torvalds
2008-08-01 17:22   ` Jens Axboe
2008-08-01 17:34     ` Dan Williams
2008-08-01 17:40       ` Jens Axboe
2008-08-01 18:22         ` Dan Williams
2008-08-01 18:29           ` Jens Axboe
2008-08-01 18:18     ` Linus Torvalds
2008-08-01 18:22       ` Jens Axboe [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=20080801182227.GI20055@kernel.dk \
    --to=jens.axboe@oracle.com \
    --cc=ajones@riverbed.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=rjw@sisk.pl \
    --cc=torvalds@linux-foundation.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.