Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753781AbbKBOEm (ORCPT ); Mon, 2 Nov 2015 09:04:42 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39121 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753735AbbKBOEj (ORCPT ); Mon, 2 Nov 2015 09:04:39 -0500 From: Jeff Moyer To: Ming Lei Cc: Jens Axboe , Jason Luo , Linux Kernel Mailing List , Guru Anbalagane , Feng Jin , Tejun Heo Subject: Re: [patch, v2] blk-mq: avoid excessive boot delays with large lun counts References: X-PGP-KeyID: 1F78E1B4 X-PGP-CertKey: F6FE 280D 8293 F72C 65FD 5A58 1FF8 A7CA 1F78 E1B4 X-PCLoadLetter: What the f**k does that mean? Date: Mon, 02 Nov 2015 09:04:37 -0500 In-Reply-To: (Ming Lei's message of "Sun, 1 Nov 2015 08:32:46 +0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2206 Lines: 64 Ming Lei writes: > You can add > Reviewed-by: Ming Lei > 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); >> } >> -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/