Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp602610pxj; Tue, 18 May 2021 10:03:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOoaeowWuvcQ+grb4gip7isFeUhuz8gLamN71F7MvUQ2KlJfMUsu/R1XFd5gO4O4zSP+qb X-Received: by 2002:a5e:dc49:: with SMTP id s9mr5121319iop.202.1621357402975; Tue, 18 May 2021 10:03:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621357402; cv=none; d=google.com; s=arc-20160816; b=Cz3Esqw33NJ7WHInz7QE5Gd5ZD8J/ODUn/FkLZPt7J/ncPfjIvW7Ma83UmEkOBPvsJ sqpoUFUepHFu5HydD41f+msFw0sZinQk5EImMXp17cZu5j1xQx7jU6+TbyUsesQjZ90K z5vwNucZFMFN+WvI+rQ9gpPyQxezpETA52FAttLBeqGEmUiPhFHsjv76BlitJ25xAaFX PBp15y2PmPsgStzXtFID2upyK8Up18DxphQchtFGYnMBALo/+EGgKT+UkIk53wdfly2o BlrzZWPwvjKmC9E/sO32NtGm5QLqcKK9e8O6DnIOHjNLKBmqX51FaQiOJqg8n5DxmRW8 VX3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gL7JJ6LKQQDak6AxAQd/EpVi6fmBq3fQbNUdQHCgMpA=; b=sYImNr37r/US8dZ/M1g51YUyEs2wZKqsE3AJ0qQAl0rsDD0ZsL8pg11QdFRqkCM8Av UbsU2hftDSZaRd26HGyRM49NW92dZhi8eqdYVpYKI+osYrYWvIp5JtjQOTTAvUWoxIuR Ukw4Um4jnv49Hxm2jNRgWU5phvvJPm6BTsTupmcxFimfno0ieiM+begm4dnSdzXKEeno LrrWaKZPRgk12EOW4bk6kWZxzj4jGO88ccY4WDdLlq3MhCmnETaUcxVhRznFlIRcF597 NDDhzHSAeb1EKFqpdt9ldQIC5D+Uk5n1RUkyC7C+XWTofc+GRHXY87/EP3IdYtHruu9M S10g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QsqdwUR8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b9si317256ilo.48.2021.05.18.10.02.59; Tue, 18 May 2021 10:03:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QsqdwUR8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344021AbhEQQIX (ORCPT + 99 others); Mon, 17 May 2021 12:08:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:36524 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344727AbhEQPpd (ORCPT ); Mon, 17 May 2021 11:45:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EFB9C61D32; Mon, 17 May 2021 14:43:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621262629; bh=AEQj4I1aVizMTYGK+X8TePKWxM0aNgV4kof9vlZOQcM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QsqdwUR829OwL6nfzWHwo6rlf+ArU4CSjHEhOoWUb4By9SXKvnifaUT3lbtF/B4Ql ExRuM3dgIrCHV93YCtQZpwTrwXe/CilKwwumAvltJOmBIw7MaTVyPHBmbBLOdUm4X5 sdj8/dQCMk82kuXQvTDt2XP96/ZmrrgnM0xVFtzA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yanhui Ma , John Garry , Bart Van Assche , kashyap.desai@broadcom.com, Ming Lei , Jens Axboe , Sasha Levin Subject: [PATCH 5.10 238/289] blk-mq: plug request for shared sbitmap Date: Mon, 17 May 2021 16:02:43 +0200 Message-Id: <20210517140313.182514840@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ming Lei [ Upstream commit 03f26d8f11403295de445b6e4e0e57ac57755791 ] In case of shared sbitmap, request won't be held in plug list any more sine commit 32bc15afed04 ("blk-mq: Facilitate a shared sbitmap per tagset"), this way makes request merge from flush plug list & batching submission not possible, so cause performance regression. Yanhui reports performance regression when running sequential IO test(libaio, 16 jobs, 8 depth for each job) in VM, and the VM disk is emulated with image stored on xfs/megaraid_sas. Fix the issue by recovering original behavior to allow to hold request in plug list. Cc: Yanhui Ma Cc: John Garry Cc: Bart Van Assche Cc: kashyap.desai@broadcom.com Fixes: 32bc15afed04 ("blk-mq: Facilitate a shared sbitmap per tagset") Signed-off-by: Ming Lei Link: https://lore.kernel.org/r/20210514022052.1047665-1-ming.lei@redhat.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- block/blk-mq.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 2a1eff60c797..4cd623a7383c 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2203,8 +2203,9 @@ blk_qc_t blk_mq_submit_bio(struct bio *bio) /* Bypass scheduler for flush requests */ blk_insert_flush(rq); blk_mq_run_hw_queue(data.hctx, true); - } else if (plug && (q->nr_hw_queues == 1 || q->mq_ops->commit_rqs || - !blk_queue_nonrot(q))) { + } else if (plug && (q->nr_hw_queues == 1 || + blk_mq_is_sbitmap_shared(rq->mq_hctx->flags) || + q->mq_ops->commit_rqs || !blk_queue_nonrot(q))) { /* * Use plugging if we have a ->commit_rqs() hook as well, as * we know the driver uses bd->last in a smart fashion. -- 2.30.2