From: "jianchao.wang" <jianchao.w.wang@oracle.com>
To: Bart Van Assche <bvanassche@acm.org>,
axboe@kernel.dk, tj@kernel.org, kent.overstreet@gmail.com,
ming.lei@redhat.com, bart.vanassche@wdc.com
Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 0/3] blk-mq: rework queue freeze and preempt-only
Date: Fri, 21 Sep 2018 09:51:52 +0800 [thread overview]
Message-ID: <0e6caed5-33eb-e645-f452-3dfc6c20206d@oracle.com> (raw)
In-Reply-To: <1537463217.224533.4.camel@acm.org>
Hi Bart
On 09/21/2018 01:06 AM, Bart Van Assche wrote:
> On Thu, 2018-09-20 at 18:18 +0800, Jianchao Wang wrote:
>> The current queue freeze depending on percpu_ref_kil/reinit has a limit that
>> we have drain the requests before unfreeze the queue.
>>
>> Let's rework the queue freeze feature as following:
>> 1. introduce __percpu_ref_get_many.
>> It is same with original percpu_ref_get_many, but just need callers to provide
>> sched rcu critical section. We will put the __percpu_ref_get_many and our own
>> condition checking under rcu_read_lock_sched. With this new helper interface,
>> we could save an extra rcu_read_lock_sched.
>> 2. rework the blk_queue_enter as:
>>
>> rcu_read_lock_sched()
>> if condition check true
>> __percpu_ref_get_many(&q->q_usage_counter, 1)
>> else
>> goto wait
>> rcu_read_unlock_sched()
>> 3. use percpu_ref_switch_to_atomic/percpu to switch mode directly.
>>
>> Then we could unfreeze the queue w/o draining requests.
>> In addition, preempt-only mode code could be simplified.
> Hello Jianchao,
> =
> Thanks for having taken a look. However, the approach of this patch series
> may be more complicated than necessary. Had you considered something like
> the patch below?
This patch is just a trying that let our life easier w/o changing anything in percpu-ref code. :)
In fact, the 1st patch which introduces a new non-functional-changing helper interface in
percpu-ref code is not necessary.
This patchset just implement our own condition checking in blk_queue_enter instead of depending on
__PERCPU_REF_DEAD checking in percpu_ref_tryget_live.
Then we could do more thing here, like:
- unfreeze the queue without draining requests.
- check whether q->q_usage_counter is zero
- add other gate conditions into blk_queue_enter, such as preempt-only, even any others.
So why not try it ?
Thanks
Jianchao
next prev parent reply other threads:[~2018-09-21 1:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-20 10:18 [RFC PATCH 0/3] blk-mq: rework queue freeze and preempt-only Jianchao Wang
2018-09-20 10:18 ` [PATCH 1/3] percpu_ref: add a new helper interface __percpu_ref_get_many Jianchao Wang
2018-09-20 20:53 ` Tejun Heo
2018-09-21 1:45 ` jianchao.wang
2018-09-20 10:18 ` [PATCH 2/3] blk-core: rework the queue freeze Jianchao Wang
2018-09-20 10:18 ` [PATCH 3/3] block, scsi: rework the preempt only mode Jianchao Wang
2018-09-20 17:06 ` [RFC PATCH 0/3] blk-mq: rework queue freeze and preempt-only Bart Van Assche
2018-09-21 1:51 ` jianchao.wang [this message]
2018-09-21 2:13 ` Bart Van Assche
2018-09-21 2:24 ` jianchao.wang
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=0e6caed5-33eb-e645-f452-3dfc6c20206d@oracle.com \
--to=jianchao.w.wang@oracle.com \
--cc=axboe@kernel.dk \
--cc=bart.vanassche@wdc.com \
--cc=bvanassche@acm.org \
--cc=kent.overstreet@gmail.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).