Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19151944rwd; Wed, 28 Jun 2023 05:55:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4iiUOJaxAJIIRhTnZ0lxpx+dC4PEQkHKxA4qEmNuD18XNilbbiPdelysdvRoe/7ZfFQV+S X-Received: by 2002:a17:907:7246:b0:991:b7f4:31dd with SMTP id ds6-20020a170907724600b00991b7f431ddmr1150364ejc.2.1687956899830; Wed, 28 Jun 2023 05:54:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687956899; cv=none; d=google.com; s=arc-20160816; b=CIkaGqFjYnL4I+U3AoWQSBvKi/oOP85P2MKv48qcGWbdPQcGmkhm2r2TOEYOR2twh5 Cpe6VRKvDFw54tJupX3kKkcVsevG9ixc0B25B0lXGCev5edQ39ZSiTe0cMv6/B8YkT09 LDgnESqp3QMmy6OuEh/urlFWPEoUCIYX3LixiJ1/ajkLkhBZuG9zGiRJR18crdgqbO6A THFzL4ZCwM9K7vZwmt/BfH8vq94Yu55m1RWNsZXMOzfx0gZsuhXH4/cCRpu4Azbk2auf kW6WJ+8lyM0FJBThKRGc2Rw9Dutd/RdBJBjVSVzKqW9KT7gOhjDboKyOgsTrvgehxCcu mTrg== 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=31zIMtFISDxe0nf6R4yblT+SRwQAWnTU/Z0saBZBUxs=; fh=lfhyp4TQmAVJIcYCHUoUy74bD0K2M2yBrUVAhHYFDUg=; b=pYZpt2E/WtYCDYkMxdIRZGNJBTMZNfwmbJKAwkvDjIfz95/kLnXvoZQujynAFw1AUm yKssUxfE6DOBTrr2wcXY+itHodVSqdpE42p16zTYMJISI534LGdF2CC+zDAKatIHrAZX wSo1OsNCFajLzvs4q5xssVk3K/L4qOD1JoTIXlnjVbGJgDIqzPoQzb9fK4aA5UPiJoV7 86cxdY/74yfdDN+gTQfuUzMwXglVAXEb4/9Fc6w1dm75aBZcpQr9mHUYZOvRq3hGs2oH Ow1wvEw1Vy+XBxNSAN0xGWYi6jny9yszYcaWXVq2A5HRimF20fhinma3uNPVx8k7G/s5 hzwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=wRvAfwCA; 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 gx4-20020a170906f1c400b0098f564f6369si4208846ejb.1006.2023.06.28.05.54.35; Wed, 28 Jun 2023 05:54:59 -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=wRvAfwCA; 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 S231585AbjF1MsB (ORCPT + 99 others); Wed, 28 Jun 2023 08:48:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231648AbjF1MrY (ORCPT ); Wed, 28 Jun 2023 08:47:24 -0400 Received: from out-55.mta1.migadu.com (out-55.mta1.migadu.com [IPv6:2001:41d0:203:375::37]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 317C930F1 for ; Wed, 28 Jun 2023 05:46:16 -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=1687956373; 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=31zIMtFISDxe0nf6R4yblT+SRwQAWnTU/Z0saBZBUxs=; b=wRvAfwCA0YHWDCD6pdg4Lx3RQ91lrPYkGuWE/r49pIRMNPOE4siZ5dvLnWteut/DezWkBz FuaMAQTI1+mRI1BcvOnXbvjtXdORy106/BMRYydqBwe6MBXikR79j2x/3lWDgLNRbYtKNF DfQ4mrt3IpxL8NBzeOn0+9yDlrTEjN8= From: chengming.zhou@linux.dev To: axboe@kernel.dk, tj@kernel.org Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, zhouchengming@bytedance.com, ming.lei@redhat.com, hch@lst.de Subject: [PATCH v3 0/3] blk-mq: fix start_time_ns and alloc_time_ns for pre-allocated rq Date: Wed, 28 Jun 2023 20:45:43 +0800 Message-Id: <20230628124546.1056698-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,URIBL_BLOCKED autolearn=ham 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 Hello, This patchset fix start_time_ns and alloc_time_ns for pre-allocated rq. patch 1 and 2 is preparation that we ktime_get_ns() outside batched rq init for batched requests start_time_ns setting. patch 3 is the fix patch that we set alloc_time_ns and start_time_ns to now when the pre-allocated rq is actually used. v3: - Skip setting the alloc_time_ns and start_time_ns during pre-allocation, which is clearer, as suggested by Tejun. - [v2] https://lore.kernel.org/all/20230626050405.781253-1-chengming.zhou@linux.dev/ v2: - Let blk_mq_rq_ctx_init() receive start_time_ns for batched time setting. - Set alloc_time_ns and start_time_ns when the pre-allocated rq is actually used, as suggested by Tejun. - [v1] https://lore.kernel.org/all/20230601053919.3639954-1-chengming.zhou@linux.dev/ Chengming Zhou (3): blk-mq: always use __blk_mq_alloc_requests() to alloc and init rq blk-mq: ktime_get_ns() only once for batched requests init blk-mq: fix start_time_ns and alloc_time_ns for pre-allocated rq block/blk-mq.c | 94 ++++++++++++++++++++++++------------------ include/linux/blk-mq.h | 6 +-- 2 files changed, 56 insertions(+), 44 deletions(-) -- 2.39.2