From: Bart Van Assche <Bart.VanAssche@wdc.com>
To: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"hch@infradead.org" <hch@infradead.org>,
Bart Van Assche <Bart.VanAssche@wdc.com>,
"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
"ming.lei@redhat.com" <ming.lei@redhat.com>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"axboe@fb.com" <axboe@fb.com>,
"jejb@linux.vnet.ibm.com" <jejb@linux.vnet.ibm.com>
Cc: "tj@kernel.org" <tj@kernel.org>,
"jthumshirn@suse.de" <jthumshirn@suse.de>,
"oleksandr@natalenko.name" <oleksandr@natalenko.name>
Subject: Re: [PATCH V3 7/8] block: allow to allocate req with REQF_PREEMPT when queue is preempt frozen
Date: Mon, 4 Sep 2017 04:13:26 +0000 [thread overview]
Message-ID: <1504498405.10804.10.camel@wdc.com> (raw)
In-Reply-To: <20170902131208.GA10940@ming.t460p>
T24gU2F0LCAyMDE3LTA5LTAyIGF0IDIxOjEyICswODAwLCBNaW5nIExlaSB3cm90ZToNCj4gUGxl
YXNlIGxldCB1cyBrbm93IGlmIFYzIGFkZHJlc3NlcyB5b3VyIHByZXZpb3VzIGNvbmNlcm4gYWJv
dXQgY2FsbGluZw0KPiBibGtfcXVldWVfZW50ZXJfbGl2ZSgpIGR1cmluZyBwcmVlbXB0IGZyZWV6
aW5nLg0KDQpEbyB5b3UgdW5kZXJzdGFuZCBob3cgcmVxdWVzdCBxdWV1ZSBjbGVhbnVwIHdvcmtz
PyBUaGUgYWxnb3JpdGhtIHVzZWQgZm9yDQpyZXF1ZXN0IHF1ZXVlIGNsZWFudXAgaXMgYXMgZm9s
bG93czoNCiogU2V0IHRoZSBEWUlORyBmbGFnLiBUaGlzIGZsYWcgbWFrZXMgYWxsIGxhdGVyIGJs
a19nZXRfcmVxdWVzdCgpIGNhbGxzDQogIGZhaWwuDQoqIFdhaXQgdW50aWwgYWxsIHBlbmRpbmcg
cmVxdWVzdHMga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ZSBzdGFydCBvZiB0aGlzIGUt
bWFpbCB0aHJlYWQuDQoNCkJhcnQu
WARNING: multiple messages have this Message-ID (diff)
From: Bart Van Assche <Bart.VanAssche@wdc.com>
To: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"hch@infradead.org" <hch@infradead.org>,
Bart Van Assche <Bart.VanAssche@wdc.com>,
"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
"ming.lei@redhat.com" <ming.lei@redhat.com>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"axboe@fb.com" <axboe@fb.com>,
"jejb@linux.vnet.ibm.com" <jejb@linux.vnet.ibm.com>
Cc: "tj@kernel.org" <tj@kernel.org>,
"jthumshirn@suse.de" <jthumshirn@suse.de>,
"oleksandr@natalenko.name" <oleksandr@natalenko.name>
Subject: Re: [PATCH V3 7/8] block: allow to allocate req with REQF_PREEMPT when queue is preempt frozen
Date: Mon, 4 Sep 2017 04:13:26 +0000 [thread overview]
Message-ID: <1504498405.10804.10.camel@wdc.com> (raw)
In-Reply-To: <20170902131208.GA10940@ming.t460p>
On Sat, 2017-09-02 at 21:12 +0800, Ming Lei wrote:
> Please let us know if V3 addresses your previous concern about calling
> blk_queue_enter_live() during preempt freezing.
Do you understand how request queue cleanup works? The algorithm used for
request queue cleanup is as follows:
* Set the DYING flag. This flag makes all later blk_get_request() calls
fail.
* Wait until all pending requests have finished.
* Set the DEAD flag. For the traditional block layer, this flag causes
blk_run_queue() not to call .request_fn() anymore. For blk-mq it is
guaranteed in another way that .queue_rq() won't be called anymore after
this flag has been set.
Allowing blk_get_request() to succeed after the DYING flag has been set is
completely wrong because that could result in a request being queued after
the DEAD flag has been set, resulting in either a hanging request or a kernel
crash. This is why it's completely wrong to add a blk_queue_enter_live() call
in blk_old_get_request() or blk_mq_alloc_request(). Hence my NAK for any
patch that adds a blk_queue_enter_live() call to any function called from
blk_get_request(). That includes the patch at the start of this e-mail thread.
Bart.
next prev parent reply other threads:[~2017-09-04 4:14 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-02 13:08 [PATCH V3 0/8] block/scsi: safe SCSI quiescing Ming Lei
2017-09-02 13:08 ` [PATCH V3 1/8] blk-mq: rename blk_mq_unfreeze_queue as blk_unfreeze_queue Ming Lei
2017-09-02 13:08 ` [PATCH V3 2/8] blk-mq: rename blk_mq_freeze_queue as blk_freeze_queue Ming Lei
2017-09-02 13:08 ` [PATCH V3 3/8] blk-mq: only run hw queues for blk-mq Ming Lei
2017-09-02 13:08 ` [PATCH V3 4/8] blk-mq: rename blk_mq_freeze_queue_wait as blk_freeze_queue_wait Ming Lei
2017-09-02 13:08 ` [PATCH V3 5/8] block: tracking request allocation with q_usage_counter Ming Lei
2017-09-02 13:08 ` [PATCH V3 6/8] block: introduce preempt version of blk_[freeze|unfreeze]_queue Ming Lei
2017-09-04 15:21 ` Bart Van Assche
2017-09-04 15:21 ` Bart Van Assche
2017-09-04 16:20 ` Ming Lei
2017-09-02 13:08 ` [PATCH V3 7/8] block: allow to allocate req with REQF_PREEMPT when queue is preempt frozen Ming Lei
2017-09-02 13:12 ` Ming Lei
2017-09-04 4:13 ` Bart Van Assche [this message]
2017-09-04 4:13 ` Bart Van Assche
2017-09-04 7:16 ` Ming Lei
2017-09-04 15:40 ` Bart Van Assche
2017-09-04 15:40 ` Bart Van Assche
2017-09-04 16:08 ` Ming Lei
2017-09-04 16:18 ` Bart Van Assche
2017-09-04 16:18 ` Bart Van Assche
2017-09-04 16:28 ` Ming Lei
2017-09-05 1:40 ` Bart Van Assche
2017-09-05 1:40 ` Bart Van Assche
2017-09-05 2:23 ` Ming Lei
2017-09-08 3:08 ` Ming Lei
2017-09-08 17:28 ` Bart Van Assche
2017-09-08 17:28 ` Bart Van Assche
2017-09-09 7:21 ` Ming Lei
2017-09-02 13:08 ` [PATCH V3 8/8] SCSI: preempt freeze block queue when SCSI device is put into quiesce Ming Lei
2017-09-02 14:47 ` [PATCH V3 0/8] block/scsi: safe SCSI quiescing Oleksandr Natalenko
2017-09-02 14:47 ` Oleksandr Natalenko
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=1504498405.10804.10.camel@wdc.com \
--to=bart.vanassche@wdc.com \
--cc=axboe@fb.com \
--cc=hch@infradead.org \
--cc=jejb@linux.vnet.ibm.com \
--cc=jthumshirn@suse.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=ming.lei@redhat.com \
--cc=oleksandr@natalenko.name \
--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.