public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Roland Dreier <roland@kernel.org>
Cc: "Nicholas A. Bellinger" <nab@linux-iscsi.org>,
	linux-scsi@vger.kernel.org, target-devel@vger.kernel.org
Subject: Re: [PATCH] target: Make transport_lookup_cmd_lun() locking IRQ-safe
Date: Tue, 14 Jun 2011 04:12:59 -0400	[thread overview]
Message-ID: <20110614081259.GA10379@infradead.org> (raw)
In-Reply-To: <1308023045-5257-1-git-send-email-roland@kernel.org>

On Mon, Jun 13, 2011 at 08:44:05PM -0700, Roland Dreier wrote:
> From: Roland Dreier <roland@purestorage.com>
> 
> transport_lookup_cmd_lun() may be called from interrupt context (eg
> tcm_loop_allocate_core_cmd() calls it, and it has a comment that says,
> "Can be called from interrupt context"), so it needs to use
> spin_lock_irqsave() instead of spin_lock_irq() to avoid enabling
> interrupts at the wrong time.
> 
> (And indeed the last set of lock operations, on lun_cmd_lock, were
> already using spin_lock_irqsave(), so we just need to fix the other
> two locks we take)

It currently is, but I think we'd better be off stopping to call it from
IRQ context.  Soon after we offload the work to thread context anyway.
By moving the point of offloading a little earlier we can simply the
calling conventions a lot, and keep the amount of code that needs
IRQ-safe locking minimal.


  reply	other threads:[~2011-06-14  8:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-14  3:44 [PATCH] target: Make transport_lookup_cmd_lun() locking IRQ-safe Roland Dreier
2011-06-14  8:12 ` Christoph Hellwig [this message]
2011-06-14 15:58   ` Roland Dreier
2011-06-16 12:15     ` Christoph Hellwig
2011-06-15 16:58   ` Nicholas A. Bellinger
2011-06-16 12:18     ` Christoph Hellwig
2011-06-15 17:06 ` Nicholas A. Bellinger
2011-06-15 17:22   ` Roland Dreier
2011-06-15 17:25     ` Nicholas A. Bellinger
2011-06-15 17:52       ` Kiran Patil
2011-06-15 19:41         ` Roland Dreier
2011-06-15 20:53           ` Kiran Patil
2011-06-15 18:53       ` Roland Dreier

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=20110614081259.GA10379@infradead.org \
    --to=hch@infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=nab@linux-iscsi.org \
    --cc=roland@kernel.org \
    --cc=target-devel@vger.kernel.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