From patchwork Tue Feb 20 08:49:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13563617 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D4155C48BC3 for ; Tue, 20 Feb 2024 08:49:49 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.683235.1062667 (Exim 4.92) (envelope-from ) id 1rcLos-0007Gl-R7; Tue, 20 Feb 2024 08:49:42 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 683235.1062667; Tue, 20 Feb 2024 08:49:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rcLos-0007Gc-O9; Tue, 20 Feb 2024 08:49:42 +0000 Received: by outflank-mailman (input) for mailman id 683235; Tue, 20 Feb 2024 08:49:41 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1rcLor-0006U9-2J for xen-devel@lists.xenproject.org; Tue, 20 Feb 2024 08:49:41 +0000 Received: from bombadil.infradead.org (bombadil.infradead.org [2607:7c80:54:3::133]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id fba6f962-cfcc-11ee-8a52-1f161083a0e0; Tue, 20 Feb 2024 09:49:40 +0100 (CET) Received: from 2a02-8389-2341-5b80-39d3-4735-9a3c-88d8.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:39d3:4735:9a3c:88d8] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcLoo-0000000DnUj-02wS; Tue, 20 Feb 2024 08:49:38 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: fba6f962-cfcc-11ee-8a52-1f161083a0e0 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:To:From:Sender: Reply-To:Cc:Content-Type:Content-ID:Content-Description; bh=qK76sLiKHDaIugADThNdCeAdCITdHp3R7WCpvZ/50Ys=; b=q+Xuv9UDwXHK+tkLGsYolzNTXG R4i+Mt0BZDHHWj0bFjoTaTV4Uf+ZLRjvOqwQnQ1QjdrjASB6LM+HWRzK56SCswy2aYtxd+lwQfOUz M1bu2VrcT7cgwkCOsvMNYemtsmevCZLF7gegxUDWG7sE9LYMV7Jb7xt7TyJ/9iUSdR4RG5IIK1ajt m5YEP4N9yEmyRAdoE62Vt5brNcei+BJohjnoWUwfYatrm4fKoPJDech8QrTVHR7nWoGlpFKJoBK6e /0W1zm/+qrYqHmXJDwLThtVyh3O1D/IfYEdgsCSgxxBHtaCdU8NUXUWYRwFAljvbygirx8S5992Sk E75cYLdg==; From: Christoph Hellwig To: Juergen Gross , Stefano Stabellini , Oleksandr Tyshchenko , =?utf-8?q?Roger_Pau_M?= =?utf-8?q?onn=C3=A9?= , Jens Axboe , xen-devel@lists.xenproject.org, linux-block@vger.kernel.org Subject: [PATCH 3/4] xen-blkfront: don't redundantly set max_sements in blkif_recover Date: Tue, 20 Feb 2024 09:49:34 +0100 Message-Id: <20240220084935.3282351-4-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240220084935.3282351-1-hch@lst.de> References: <20240220084935.3282351-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html blkif_set_queue_limits already sets the max_sements limits, so don't do it a second time. Also remove a comment about a long fixe bug in blk_mq_update_nr_hw_queues. Signed-off-by: Christoph Hellwig Acked-by: Roger Pau Monné --- drivers/block/xen-blkfront.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 1258f24b285500..7664638a0abbfa 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -2008,14 +2008,10 @@ static int blkif_recover(struct blkfront_info *info) struct request *req, *n; int rc; struct bio *bio; - unsigned int segs; struct blkfront_ring_info *rinfo; blkfront_gather_backend_features(info); - /* Reset limits changed by blk_mq_update_nr_hw_queues(). */ blkif_set_queue_limits(info); - segs = info->max_indirect_segments ? : BLKIF_MAX_SEGMENTS_PER_REQUEST; - blk_queue_max_segments(info->rq, segs / GRANTS_PER_PSEG); for_each_rinfo(info, rinfo, r_index) { rc = blkfront_setup_indirect(rinfo); @@ -2035,7 +2031,9 @@ static int blkif_recover(struct blkfront_info *info) list_for_each_entry_safe(req, n, &info->requests, queuelist) { /* Requeue pending requests (flush or discard) */ list_del_init(&req->queuelist); - BUG_ON(req->nr_phys_segments > segs); + BUG_ON(req->nr_phys_segments > + (info->max_indirect_segments ? : + BLKIF_MAX_SEGMENTS_PER_REQUEST)); blk_mq_requeue_request(req, false); } blk_mq_start_stopped_hw_queues(info->rq, true);