From: Jeff Garzik <jeff@garzik.org>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Linux-SCSI <linux-scsi@vger.kernel.org>,
akpm@linux-foundation.org
Subject: Re: [PATCH v4 1/2] SCSI: Asynchronous event notification infrastructure
Date: Mon, 29 Oct 2007 12:07:34 -0400 [thread overview]
Message-ID: <47260546.9090508@garzik.org> (raw)
In-Reply-To: <1193673088.3383.34.camel@localhost.localdomain>
James Bottomley wrote:
> This still doesn't solve the fundamental corruption problem:
> sdev->event_work has to contain the work entry until the workqueue has
> finished executing it (which is some unspecified time in the future).
> As soon as you drop the sdev->list_lock, the system thinks
> sdev->event_work is available for reuse. If we fire another event
> before the work queue finished processing the prior event, the queue
> will be corrupted.
I think you're misunderstanding the workqueue code? You can call
schedule_work(&sdev->event_work) from anywhere, any time you like, as
many times as you like.
> Also, I think Kristin's initial use of execute_in_user_context() was a
> good call .. if we already have a user context, there's no need to
> bother the workqueue ... some of these events will likely trigger from
> thread backed kernel daemons.
Quite agreed that sdev_evt_notify() might be called from kernel daemons,
but in general this is a fire-and-forget API that is -likely- to be
called from interrupt or completion context of many drivers, just like
scsi_done or other completion APIs. It is a fundamentally parallel
interface.
If thread-backed kernel daemons want to use this, it is trivial for them
to schedule work, then sync.
Jeff
next prev parent reply other threads:[~2007-10-29 16:07 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-29 14:42 [PATCH v4 0/2] [SCSI] Asynchronous event notification infrastructure Jeff Garzik
2007-10-29 14:42 ` [PATCH v4 1/2] SCSI: " Jeff Garzik
2007-10-29 15:51 ` James Bottomley
2007-10-29 16:07 ` Jeff Garzik [this message]
2007-10-29 16:17 ` James Bottomley
2007-10-29 16:29 ` Jeff Garzik
2007-10-29 17:01 ` James Bottomley
2007-10-29 21:31 ` [PATCH v5 0/2] SCSI asynchronous event notification API Jeff Garzik
2007-10-29 21:31 ` [PATCH v5 1/2] SCSI: add " Jeff Garzik
2007-10-29 21:31 ` [PATCH v5 2/2] libata: Utilize new SCSI event infrastructure Jeff Garzik
2007-10-29 14:42 ` [PATCH v4 " Jeff Garzik
2007-10-29 15:43 ` [PATCH v4 0/2] [SCSI] Asynchronous event notification infrastructure James Bottomley
2007-10-29 15:58 ` Jeff Garzik
2007-10-29 16:10 ` James Bottomley
2007-10-29 16:24 ` Jeff Garzik
2007-10-29 16:34 ` James Bottomley
2007-10-29 16:48 ` Jeff Garzik
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=47260546.9090508@garzik.org \
--to=jeff@garzik.org \
--cc=James.Bottomley@SteelEye.com \
--cc=akpm@linux-foundation.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox