Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp20585802rwd; Thu, 29 Jun 2023 04:32:29 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4pHZ4ccQXASSaBIYtlz6Mawf6E8iPXgVijpeav9I5idOw9je4nB++Cg8YujeKKIuJSl+6X X-Received: by 2002:a05:6a00:1391:b0:680:9b18:6c70 with SMTP id t17-20020a056a00139100b006809b186c70mr4811191pfg.7.1688038349353; Thu, 29 Jun 2023 04:32:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688038349; cv=none; d=google.com; s=arc-20160816; b=N1Xah9BN91FODXNBSpV9arzwrE4bLp48Oukp7Qrd4KOLrRvqHhbmsA3DdGhL/DpM10 nwZwXQF6Klij0AcRco4r9owH5LUjzjJcn//g0RoljN5gB3i9ZITm1WgjqZFDYn1N2bvl r2YSw80WWh/zmEB92dY3Xhe8ngPhhgC4KErXX/MQKRSsNesFPDA30P7hB67kiYNQfRCi wLXdYXiMP3e7L11XuqyIP6lKmajdcCnaFr7OwxruSPdpTJbs/cEkK+6ZhHB8ybJsU4aZ DVOw8EhVijcPPmoFHRIhQ6obEKJNt0SgjvvYUFAFHy+HIz9z5HjOmZDahMehXpAK/41D 8Zcw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=oSLJao9f5JaszPoImqsUvDRSvTMFoJRzT3O/9NnVAD8=; fh=jVO2EC1fXvr6Bl8+7yHtFIrYqo7iQ9dvd55sFdmq7po=; b=c1koC2zyfS8xH/OdRQjUCwMovM1JVS3JfjCJOE3DvBac0nuA5Ij8mGt1YsVUExMEay 8D+5M5Jh84d3rJMIjejmXpN0QA6zdzVHuiRu3BUC1KlqDHmm3DpkThKyjkpO2d++kAku skKS44Ad1rRgaqkBOEJPaH0xKKnEIwJt5UzBftpHVeBal0JkErEkC783aXGDP+UyOy4J cHq0ymB2/iy1p0jeWW2wAHd0fkbgURll1DK2ePLu3wkoxBuDXyY+4Yr69mTblWeIoTGD zkJyErj94Ih+ZCwXAdAUa4wfZMfjotlB94mB3UAAEXgUGKcQAsLignjE1d2cakuLTMnN FGcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=qKEKzK9F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b185-20020a62cfc2000000b00660f49fdc5dsi10172139pfg.258.2023.06.29.04.32.15; Thu, 29 Jun 2023 04:32:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=qKEKzK9F; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232152AbjF2LHR (ORCPT + 99 others); Thu, 29 Jun 2023 07:07:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230456AbjF2LHO (ORCPT ); Thu, 29 Jun 2023 07:07:14 -0400 Received: from out-38.mta1.migadu.com (out-38.mta1.migadu.com [IPv6:2001:41d0:203:375::26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AF47E72 for ; Thu, 29 Jun 2023 04:07:13 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1688036830; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=oSLJao9f5JaszPoImqsUvDRSvTMFoJRzT3O/9NnVAD8=; b=qKEKzK9F9eMP5JoByRJSooGFJrjAc4+lsvHOceAaimvo6wrsFv6HRkkH/a86fKdP18B4Va VnHHuaU49jZZtFXJ4P0vWMFs93yY6lSjgcC9OmsFyu3aL1+BHdAWV/iyllaPgaWAvhrKbP 1f1N5uVg8OoieHcBjidLRE7dCkiFgL8= From: chengming.zhou@linux.dev To: axboe@kernel.dk, ming.lei@redhat.com, hch@lst.de, tj@kernel.org Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Chengming Zhou Subject: [PATCH v2 0/4] blk-mq: optimize the size of struct request Date: Thu, 29 Jun 2023 19:03:55 +0800 Message-Id: <20230629110359.1111832-1-chengming.zhou@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chengming Zhou v2: - Change to use call_single_data_t, which use __aligned() to avoid to use 2 cache lines for 1 csd. Thanks Ming Lei. - [v1] https://lore.kernel.org/all/20230627120854.971475-1-chengming.zhou@linux.dev/ Hello, After the commit be4c427809b0 ("blk-mq: use the I/O scheduler for writes from the flush state machine"), rq->flush can't reuse rq->elv anymore, since flush_data requests can go into io scheduler now. That increased the size of struct request by 24 bytes, but this patchset can decrease the size by 40 bytes, which is good I think. patch 1 use percpu csd to do remote complete instead of per-rq csd, decrease the size by 24 bytes. patch 2-3 reuse rq->queuelist in flush state machine pending list, and maintain a u64 counter of inflight flush_data requests, decrease the size by 16 bytes. patch 4 is just cleanup by the way. Thanks for comments! Chengming Zhou (4): blk-mq: use percpu csd to remote complete instead of per-rq csd blk-flush: count inflight flush_data requests blk-flush: reuse rq queuelist in flush state machine blk-mq: delete unused completion_data in struct request block/blk-flush.c | 19 +++++++++---------- block/blk-mq.c | 12 ++++++++---- block/blk.h | 5 ++--- include/linux/blk-mq.h | 10 ++-------- 4 files changed, 21 insertions(+), 25 deletions(-) -- 2.39.2