All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: dm-devel@redhat.com, "Alasdair G. Kergon" <agk@redhat.com>
Subject: Re: dm-snap: optimize track_chunk
Date: Tue, 16 Oct 2012 20:01:15 -0400	[thread overview]
Message-ID: <20121017000115.GA3540@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1210161904120.19889@file.rdu.redhat.com>

On Tue, Oct 16 2012 at  7:04pm -0400,
Mikulas Patocka <mpatocka@redhat.com> wrote:

> dm-snap: optimize track_chunk
> 
> track_chunk is always called with interrupts enabled. Consequently, we
> do not need to save and restore interrupt state in "flags" variable.
> This patch changes spin_lock_irqsave to spin_lock_irq and
> spin_unlock_irqrestore to spin_unlock_irq.
> 
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> 
> ---
>  drivers/md/dm-snap.c |    5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> Index: linux-3.6.2-fast/drivers/md/dm-snap.c
> ===================================================================
> --- linux-3.6.2-fast.orig/drivers/md/dm-snap.c	2012-10-17 00:43:01.000000000 +0200
> +++ linux-3.6.2-fast/drivers/md/dm-snap.c	2012-10-17 00:43:22.000000000 +0200
> @@ -201,14 +201,13 @@ static struct dm_snap_tracked_chunk *tra
>  {
>  	struct dm_snap_tracked_chunk *c = mempool_alloc(s->tracked_chunk_pool,
>  							GFP_NOIO);
> -	unsigned long flags;
>  
>  	c->chunk = chunk;
>  
> -	spin_lock_irqsave(&s->tracked_chunk_lock, flags);
> +	spin_lock_irq(&s->tracked_chunk_lock);

Does is make any sense to add "BUG_ON(irqs_disabled());" before the spin_lock_irq?

  reply	other threads:[~2012-10-17  0:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-16 23:04 [PATCH] dm-snap: optimize track_chunk Mikulas Patocka
2012-10-17  0:01 ` Mike Snitzer [this message]
2012-10-17  0:44   ` Mikulas Patocka

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=20121017000115.GA3540@redhat.com \
    --to=snitzer@redhat.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=mpatocka@redhat.com \
    /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.