From: Bart Van Assche <bvanassche@acm.org>
To: Jens Axboe <axboe@kernel.dk>
Cc: Tejun Heo <tj@kernel.org>,
device-mapper development <dm-devel@redhat.com>,
linux-scsi <linux-scsi@vger.kernel.org>,
Alasdair G Kergon <agk@redhat.com>,
Mike Snitzer <snitzer@redhat.com>,
James Bottomley <JBottomley@parallels.com>
Subject: Re: [PATCH 1/2] block: Avoid invoking blk_run_queue() recursively
Date: Sat, 23 Feb 2013 13:34:53 +0100 [thread overview]
Message-ID: <5128B76D.4040004@acm.org> (raw)
In-Reply-To: <20130222190129.GD25064@kernel.dk>
On 02/22/13 20:01, Jens Axboe wrote:
> That'd be fine. I agree with Tejun that just returning is error prone
> and could cause hard-to-debug hangs or stalls. So something ala
>
> if (blk_queue(dead))
> return;
> else if (q->request_fn_active) {
> blk_delay_queue(q, 0);
> return;
> }
>
> would work. Alternatively, you could mark the queue as needing a re-run,
> so any existing runner of it would notice and clear this flag and re-run
> the queue. But that's somewhat more fragile, and since it isn't a
> hot/performance path, I suspect the simple "just re-run me soon" is good
> enough.
I'm worried that in the device mapper the approach using
blk_delay_queue() could trigger a queue run after the final dm_put().
And I'm also afraid that that approach could trigger several needless
context switches before q->request_fn_active finally drops to zero. So
the approach with the "need re-run" flag seems preferable to me. But
maybe I'm overlooking something ?
Bart.
next prev parent reply other threads:[~2013-02-23 12:34 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-22 10:45 [PATCH 0/2] dm: Avoid use-after-free of a mapped device Bart Van Assche
2013-02-22 10:46 ` [PATCH 1/2] block: Avoid invoking blk_run_queue() recursively Bart Van Assche
2013-02-22 18:14 ` Tejun Heo
2013-02-22 18:57 ` Bart Van Assche
2013-02-22 19:01 ` Jens Axboe
2013-02-23 12:34 ` Bart Van Assche [this message]
2013-02-22 10:47 ` [PATCH 2/2] dm: Avoid use-after-free of a mapped device Bart Van Assche
2013-02-22 11:08 ` Mike Snitzer
2013-02-22 11:22 ` Bart Van Assche
2013-02-22 11:28 ` Mike Snitzer
2013-02-25 9:49 ` Jun'ichi Nomura
2013-02-25 15:09 ` Bart Van Assche
2013-02-26 0:30 ` Jun'ichi Nomura
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=5128B76D.4040004@acm.org \
--to=bvanassche@acm.org \
--cc=JBottomley@parallels.com \
--cc=agk@redhat.com \
--cc=axboe@kernel.dk \
--cc=dm-devel@redhat.com \
--cc=linux-scsi@vger.kernel.org \
--cc=snitzer@redhat.com \
--cc=tj@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.