public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: Christoph Hellwig <hch@infradead.org>
Cc: Roland Dreier <roland@kernel.org>,
	linux-scsi@vger.kernel.org, target-devel@vger.kernel.org
Subject: Re: [PATCH] target: Make transport_lookup_cmd_lun() locking IRQ-safe
Date: Wed, 15 Jun 2011 09:58:41 -0700	[thread overview]
Message-ID: <1308157121.20109.23.camel@haakon2.linux-iscsi.org> (raw)
In-Reply-To: <20110614081259.GA10379@infradead.org>

On Tue, 2011-06-14 at 04:12 -0400, Christoph Hellwig wrote:
> 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.
> 

The thing here is that the new descriptor can't be offloaded into thread
context for TFO->new_cmd_map() processing until the se_cmd->se_dev
assignment has occured, because we don't know which backend it's
destined for.

So, I think we at least need this patch..

--nab



  parent reply	other threads:[~2011-06-15 17:07 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
2011-06-14 15:58   ` Roland Dreier
2011-06-16 12:15     ` Christoph Hellwig
2011-06-15 16:58   ` Nicholas A. Bellinger [this message]
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=1308157121.20109.23.camel@haakon2.linux-iscsi.org \
    --to=nab@linux-iscsi.org \
    --cc=hch@infradead.org \
    --cc=linux-scsi@vger.kernel.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