From patchwork Thu Jun 2 05:18:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 9149067 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3F17460467 for ; Thu, 2 Jun 2016 05:19:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FEB025EF7 for ; Thu, 2 Jun 2016 05:19:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2049B271FD; Thu, 2 Jun 2016 05:19:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92B3625EF7 for ; Thu, 2 Jun 2016 05:18:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751232AbcFBFS6 (ORCPT ); Thu, 2 Jun 2016 01:18:58 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:33947 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751121AbcFBFS5 (ORCPT ); Thu, 2 Jun 2016 01:18:57 -0400 Received: by mail-pa0-f45.google.com with SMTP id bz2so2823799pad.1 for ; Wed, 01 Jun 2016 22:18:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=6PlWsVrnTTgTotB06C+1S+pVeeAJuB+Tlvu81DFQuHI=; b=IIDJj4OnQllAJ1U7PzG82Ze22JJagDmTBWk46hwZcjDdGlournG2LqdcTb8KC6OKIu JRjHlbxmVitERKI2lheahZCynpg3cbWGpkGf5fR03erNcXGKsag5zkdjHu8DxmLLGqci atPm7luE78NCNpDh6MzY6b7FKheLSSIyRnAQ246fisBBswwTTdaIPc9qNIrhqa6+ywn3 alJ8ofn4S37m6h9kfxJ14bBPrCZ5rA/3TEy1lKU22sROXuzwFRY4jEkFdiF3dbF5Ag8P Zcr3iauRqg/aZSGTvS64RylY2L2B3mksz3KtgZNlgow0Wq/Mxqvl2y3ghHPruk/lHx4c TRGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6PlWsVrnTTgTotB06C+1S+pVeeAJuB+Tlvu81DFQuHI=; b=NJXpO7RHvwHc9FYzcPum3tVQ1PPl+SsrL1L0AAApfni9MBmqiSfVx6swuTpitLcF9D C5giWE7TBCdCbJjFL0fgNHuFsBH1duH+uCG4y9tm1e68CItTSRc3wKLb31TC3cXt6IO7 63TQe9/4bB9zTAOu4HSwKLvT9M4Vvq0r382t4ceejeMx9gK2j3QRPvp1h9QXuAZtNEJ2 olmPKZICcj3OoGF7Dw6KpPTEY1O6VnforEJf3RGeiDrOIkPcTjTfmOCaaG9rb6OloH6m +UU4FhFN2BcULz2tEIc+aYsUt2yLqYjA0FoXD5nbfSOscO8sk3yYmaaHw5WIuDfDGmNC nHYw== X-Gm-Message-State: ALyK8tIg8jewLYkPku27Vg17+inUbyjfpwwQ+7YNkPpaeYBOSOlANKGFKh0VoMt1TLvYvfNX X-Received: by 10.66.231.35 with SMTP id td3mr2956831pac.56.1464844737581; Wed, 01 Jun 2016 22:18:57 -0700 (PDT) Received: from vader.thefacebook.com ([2620:10d:c090:180::1:8e2c]) by smtp.gmail.com with ESMTPSA id d4sm1664043pfa.23.2016.06.01.22.18.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Jun 2016 22:18:57 -0700 (PDT) From: Omar Sandoval X-Google-Original-From: Omar Sandoval To: Jens Axboe Cc: Jeff Moyer , linux-block@vger.kernel.org, kernel-team@fb.com, Omar Sandoval Subject: [PATCH] blk-mq: really fix plug list flushing for nomerge queues Date: Wed, 1 Jun 2016 22:18:48 -0700 Message-Id: X-Mailer: git-send-email 2.8.3 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Omar Sandoval Commit 0809e3ac6231 ("block: fix plug list flushing for nomerge queues") updated blk_mq_make_request() to set request_count even when blk_queue_nomerges() returns true. However, blk_mq_make_request() only does limited plugging and doesn't use request_count; blk_sq_make_request() is the one that should have been fixed. Do that and get rid of the unnecessary work in the mq version. Fixes: 0809e3ac6231 ("block: fix plug list flushing for nomerge queues") Signed-off-by: Omar Sandoval Reviewed-by: Ming Lei Reviewed-by: Jeff Moyer --- Applies to v4.7-rc1. block/blk-mq.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 29cbc1b5fbdb..f9b9049b1284 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1262,12 +1262,9 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) blk_queue_split(q, &bio, q->bio_split); - if (!is_flush_fua && !blk_queue_nomerges(q)) { - if (blk_attempt_plug_merge(q, bio, &request_count, - &same_queue_rq)) - return BLK_QC_T_NONE; - } else - request_count = blk_plug_queued_count(q); + if (!is_flush_fua && !blk_queue_nomerges(q) && + blk_attempt_plug_merge(q, bio, &request_count, &same_queue_rq)) + return BLK_QC_T_NONE; rq = blk_mq_map_request(q, bio, &data); if (unlikely(!rq)) @@ -1358,9 +1355,11 @@ static blk_qc_t blk_sq_make_request(struct request_queue *q, struct bio *bio) blk_queue_split(q, &bio, q->bio_split); - if (!is_flush_fua && !blk_queue_nomerges(q) && - blk_attempt_plug_merge(q, bio, &request_count, NULL)) - return BLK_QC_T_NONE; + if (!is_flush_fua && !blk_queue_nomerges(q)) { + if (blk_attempt_plug_merge(q, bio, &request_count, NULL)) + return BLK_QC_T_NONE; + } else + request_count = blk_plug_queued_count(q); rq = blk_mq_map_request(q, bio, &data); if (unlikely(!rq))