From: Tejun Heo <tj@kernel.org>
To: "James E.J. Bottomley" <JBottomley@parallels.com>
Cc: Linux SCSI List <linux-scsi@vger.kernel.org>,
FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
lkml <linux-kernel@vger.kernel.org>,
Steven Whitehouse <swhiteho@redhat.com>
Subject: Re: [PATCH RESEND] scsi: don't use execute_in_process_context()
Date: Wed, 15 Jun 2011 12:20:22 +0200 [thread overview]
Message-ID: <20110615102022.GV8141@htj.dyndns.org> (raw)
In-Reply-To: <20110430145602.GL29280@htj.dyndns.org>
On Sat, Apr 30, 2011 at 04:56:02PM +0200, Tejun Heo wrote:
> SCSI is the only subsystem which uses execute_in_process_context() and
> its use is racy against module unload. ie. the reap work is not
> properly flushed and could still be running after the scsi module is
> unloaded.
>
> Although execute_in_process_context() can be more efficient when the
> caller already has a context, in this case, the call paths are quite
> cold and the difference is practically meaningless. With commit
> c8efcc25 (workqueue: allow chained queueing during destruction), the
> race condition can easily be fixed by using a dedicated workqueue and
> destroying it on module unload.
>
> Create and use scsi_wq instead of execute_in_process_context().
>
> * scsi_device->ew is replaced with release_work. scsi_target->ew is
> replaced with reap_work.
>
> * Both works are initialized with the respective release/reap function
> during device/target init. scsi_target_reap_usercontext() is moved
> upwards to avoid needing forward declaration.
>
> * scsi_alloc_target() now explicitly flushes the reap_work of the
> found dying target before putting it instead of depending on
> flush_scheduled_work().
>
> For more info on the issues, please read the following threads.
>
> http://thread.gmane.org/gmane.linux.scsi/62923
> http://thread.gmane.org/gmane.linux.kernel/1124773
>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Cc: Steven Whitehouse <swhiteho@redhat.com>
> --
> James, can we please get rid of execute_in_process_context()? It
> didn't help the recent crash case which was a separate issue but
> didn't break anything either, and this is one of the last several
> users of flush_scheduled_work() that I really want to remove.
(resending due to devlivery failure on suse address)
James, ping.
--
tejun
next prev parent reply other threads:[~2011-06-15 10:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-30 14:56 Tejun Heo
2011-06-15 10:18 ` Tejun Heo
2011-06-15 10:20 ` Tejun Heo [this message]
2011-07-20 16:40 ` Tejun Heo
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=20110615102022.GV8141@htj.dyndns.org \
--to=tj@kernel.org \
--cc=JBottomley@parallels.com \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=swhiteho@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®