Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp114847pxj; Mon, 17 May 2021 22:35:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRm5lqgGkZ6ZF5WCu/Ezs2hXV2+w+96iQPPkfpyeH7mDQmftLxQHDIwuDMkPaZpkoVvfz6 X-Received: by 2002:a5d:9e51:: with SMTP id i17mr2949977ioi.122.1621316119651; Mon, 17 May 2021 22:35:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621316119; cv=none; d=google.com; s=arc-20160816; b=vMqj2XY/MgYS3HYgvW7rLaXwNtxPNczd21ZQLeR6IJXkVjjdMqrcDtBlv1oro5fYvM sh8mCs8qnc9JX68njISjA3tI9+QBTlZWj1pCAHu4g9Pj9sp98Lxj6+LzrRF4F0Qbec7/ HNKk4S8rwbir7EPDN/raOPrC+DuBIoNkxutCdo7zyVau9pQOZJVdLmj+305/QzKu8Cav zRrzLDXSOePc99AJ/q1ETfLnmnkjNzW1BkKMueuuGDTtv/X6n1QGOwbC450/B6msmuml bMSES66xX2C5SAzZ7SeFYNObqhaAzE/wEtQlgz97K1t2lF4P5HnUDPd0XzmZ1sCiDMXE Z/RQ== 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=prWBgPG2mwAdtumtRgeFR1JeQ6fhTPhpGNUhOE+Fkx0=; b=FkHmHJwGNh4EE6hZsdOOD/WNii+Y5cf/HwlVCluLHLHIWMG8mguolXXH7KPXAKcdoM r2E4NNbsKeqqYZJ0Oy3V+JXcDlsraLFDll+k+JVWeqoCILfDv5wlfp9lrEYJ543OWtD0 ghWEZQrQBI0WpUP5cYZsGek34KVn0pZQG7ibVEpRARyU6de4gSHE3oHnUxrC/Cz4AZ0+ +BItfWshazrA6saVjrdR2QxRXhODq69tqRozWPwetvXa7XOp/v/5EaBlBO4dxHkI0Zm/ sGHl9ChAzBRzn/ti/Jf7ojcXC/if8fX/YVc2HsrSUAzUsLot66QauQaCHBNKR2sAPPNU C77w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QyTbcF+c; 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 a16si13703234ilr.160.2021.05.17.22.35.06; Mon, 17 May 2021 22:35:19 -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=QyTbcF+c; 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 S240955AbhEQOrC (ORCPT + 99 others); Mon, 17 May 2021 10:47:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:33954 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240868AbhEQOjU (ORCPT ); Mon, 17 May 2021 10:39:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D67C061937; Mon, 17 May 2021 14:18:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621261102; bh=PlpePXivunUZg8exTB6V4+pEmH7TIZv8X5nGFEjG21k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QyTbcF+c4KJYDLNe/ibHVysBAiSuAvCVAyxSS2xufU3epH8xjstxTpm5sElK8F5lc AfMdJZh60EjCx3npIWX80LA51aY7nWQicFdr+2v1ZhOF8Pid39RkNMYxXigsgUMjXd IhYIV6UIU6RRB4XiGpHQXzdONvlzBJ7EnIijWeio= 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.12 306/363] blk-mq: plug request for shared sbitmap Date: Mon, 17 May 2021 16:02:52 +0200 Message-Id: <20210517140312.937872656@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@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 d4d7c1caa439..c0b740be62ad 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2216,8 +2216,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