From: Jeff Moyer <jmoyer@redhat.com>
To: Ming Lei <tom.leiming@gmail.com>
Cc: Jens Axboe <axboe@kernel.dk>,
Jason Luo <zhangqing.luo@oracle.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Guru Anbalagane <guru.anbalagane@oracle.com>,
Feng Jin <joe.jin@oracle.com>, Tejun Heo <tj@kernel.org>
Subject: Re: [patch, v2] blk-mq: avoid excessive boot delays with large lun counts
Date: Mon, 02 Nov 2015 09:04:37 -0500 [thread overview]
Message-ID: <x49ziywqyyy.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <CACVXFVPwfv0-T0v9CseqrkmZEyVwUwBFBer_yoTEwxFKrBLLjw@mail.gmail.com> (Ming Lei's message of "Sun, 1 Nov 2015 08:32:46 +0800")
Ming Lei <tom.leiming@gmail.com> writes:
> You can add
> Reviewed-by: Ming Lei <ming.lei@canonical.com>
> if the following trivial issues(especially the 2nd one) are addressed.
[snip]
>> @@ -1891,7 +1890,12 @@ static void blk_mq_del_queue_tag_set(struct request_queue *q)
>>
>> mutex_lock(&set->tag_list_lock);
>> list_del_init(&q->tag_set_list);
>> - blk_mq_update_tag_set_depth(set);
>> + if (set->tag_list.next == set->tag_list.prev) {
>
> list_is_singular() should be better.
Didn't even know that existed. Thanks.
>> + /* just transitioned to unshared */
>> + set->flags &= ~BLK_MQ_F_TAG_SHARED;
>> + /* update existing queue */
>> + blk_mq_update_tag_set_depth(set, false);
>> + }
>> mutex_unlock(&set->tag_list_lock);
>> }
>>
>> @@ -1901,8 +1905,17 @@ static void blk_mq_add_queue_tag_set(struct blk_mq_tag_set *set,
>> q->tag_set = set;
>>
>> mutex_lock(&set->tag_list_lock);
>> +
>> + /* Check to see if we're transitioning to shared (from 1 to 2 queues). */
>> + if (!list_empty(&set->tag_list) && !(set->flags & BLK_MQ_F_TAG_SHARED)) {
>> + set->flags |= BLK_MQ_F_TAG_SHARED;
>> + /* update existing queue */
>> + blk_mq_update_tag_set_depth(set, true);
>> + }
>> + if (set->flags & BLK_MQ_F_TAG_SHARED)
>
> The above should be 'else if', otherwise the current queue will be set
> twice.
I moved the list add below this to avoid that very issue. See:
>> + queue_set_hctx_shared(q, true);
>> list_add_tail(&q->tag_set_list, &set->tag_list);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This seemed the cleanest way to structure the code to avoid the double
walking of the hctx list for the current q.
-Jeff
>> - blk_mq_update_tag_set_depth(set);
>> +
>> mutex_unlock(&set->tag_list_lock);
>> }
>>
next prev parent reply other threads:[~2015-11-02 14:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-30 17:22 Jeff Moyer
2015-11-01 0:32 ` Ming Lei
2015-11-02 14:04 ` Jeff Moyer [this message]
2015-11-03 1:12 ` Ming Lei
2015-11-03 13:27 ` Jeff Moyer
2015-11-03 15:23 ` Jens Axboe
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=x49ziywqyyy.fsf@segfault.boston.devel.redhat.com \
--to=jmoyer@redhat.com \
--cc=axboe@kernel.dk \
--cc=guru.anbalagane@oracle.com \
--cc=joe.jin@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@kernel.org \
--cc=tom.leiming@gmail.com \
--cc=zhangqing.luo@oracle.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®