All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: dgilbert@interlog.com, Christoph Hellwig <hch@infradead.org>
Cc: SCSI development list <linux-scsi@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	James Bottomley <james.bottomley@hansenpartnership.com>,
	Milan Broz <gmazyland@gmail.com>
Subject: Re: [PATCH] scsi_debug: deadlock between completions and surprise module removal
Date: Fri, 05 Sep 2014 17:25:04 +0200	[thread overview]
Message-ID: <5409D5D0.8060801@acm.org> (raw)
In-Reply-To: <5409C116.5060702@interlog.com>

On 09/05/14 15:56, Douglas Gilbert wrote:
> With scsi-mq I think many LLDs probably have a new
> race possibility between a surprise rmmod of the LLD
> and another thread presenting a new command at about
> the same time (or another thread's command completing
> around that time). Does anything above the LLD stop
> this happening?
>
> Looking at mpt3sas and hpsa module exit calls, they don't
> seem to guard against this possibility.
>
> The test is pretty easy: build the LLD as a module, load
> it and fire up a multi-thread, libaio fio test on one or
> more devices (SSDs would probably be good) on that LLD.
> While the test is running, do 'rmmod LLD'.

An LLD must call scsi_remove_host() directly or indirectly from the 
module cleanup path. scsi_remove_host() triggers a call to 
blk_cleanup_queue(). That last function sets the flag QUEUE_FLAG_DYING 
which prevents that new I/O is queued and waits until previously queued 
requests have finished before returning.

Bart.


  reply	other threads:[~2014-09-05 15:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-31 23:09 [PATCH] scsi_debug: deadlock between completions and surprise module removal Douglas Gilbert
2014-09-01 15:36 ` Christoph Hellwig
2014-09-01 19:52   ` Douglas Gilbert
2014-09-05  5:24 ` Christoph Hellwig
2014-09-05 13:56   ` Douglas Gilbert
2014-09-05 15:25     ` Bart Van Assche [this message]
2014-09-06 14:40       ` Douglas Gilbert
2014-09-06 14:44         ` Christoph Hellwig
2014-09-08  9:11         ` Bart Van Assche
2014-09-08 15:07           ` Christoph Hellwig
2014-09-08 20:31             ` Douglas Gilbert
2014-09-09 15:30               ` Christoph Hellwig
2014-09-25 12:13 ` Christoph Hellwig
2014-10-03 18:16   ` Elliott, Robert (Server Storage)

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=5409D5D0.8060801@acm.org \
    --to=bvanassche@acm.org \
    --cc=dgilbert@interlog.com \
    --cc=gmazyland@gmail.com \
    --cc=hch@infradead.org \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@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 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.