Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp20333186rwd; Thu, 29 Jun 2023 00:26:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4R7fCYdzkI7t4XdL0G2TMtRyAbT1BFxbBB0XL6xbvMKRH5LPGLRARUsIpbX9VJ7mfj2y8l X-Received: by 2002:a17:902:e746:b0:1b7:f3a4:a6dc with SMTP id p6-20020a170902e74600b001b7f3a4a6dcmr14510394plf.21.1688023587604; Thu, 29 Jun 2023 00:26:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688023587; cv=none; d=google.com; s=arc-20160816; b=UbxZ6O5FlA3/JN0RF0SqO/UYoacF4RomnR4wZEwLmckWrEtJFfEAfXHLET/u2oAR8H 9X4zkjJpCxBhSx8427MkcjXBuvkS9ygKOhhxamDxpuGfBBNLxJ/N6EIdqGbq+Z2kFe/7 NE/JSl2rM0ZVbRG19uyU0liW7ytza5KDhswWwb7KBpZ0vQLqvPe1uYoiX16duyWoC3rz oc9e3fz+BbKioYls8RwcwcG/IVya9lFqaLWtsXnKlhReGfYvL9/634VNnspTLEgpFTxu FovBlEGlpPyzhOsJYfjfhMsZdK+UB4A6od7KGSQgMEfieOhb20YMmhLkPHditWp1AuzJ duAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:mime-version:date :message-id; bh=ERRi5UM6uECOLTrltYkZD8W1x4VY1dM+7SyUK/xs3TA=; fh=E95mO6Y/k1vJEHpyYgO2XiaI84qGOmOvOZcIC6NX7eI=; b=XUFc7JsZnuTv//3GUirY4/Dm4Cqp3VNJcvioFgCl4i5Ps1i3sRIrOBgRhjE4WMPS36 fY0wF/rmO9bqx9E3Ws8S/N93EfmFO19nYlLn7fpiwZ8IlC3zNv88FLh3DA+0t4BoDa6B G/IFrVfPo6xu/TowX+d3JMdoo9fFAUYEinuv8GnIG7UnbN9P/WDjZUjrnB4Gi5/Rrsk9 OsZWMc0KnObtF2GDstI+8ZX4GDTwrEaY3b0l5/sh/l9s636FX++d+FoJNmYXbK2lv1Xh ZP2DBEX4x9ONsTOljgnQUgajkB5aQUkk1CDMTk+nVUCtOCFRFQ4tU3K7HfqVmdTSsUvn AR2A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 c11-20020a170902724b00b001b1a2c14a48si9486968pll.141.2023.06.29.00.26.12; Thu, 29 Jun 2023 00:26:27 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231447AbjF2GqL (ORCPT + 99 others); Thu, 29 Jun 2023 02:46:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232196AbjF2GpL (ORCPT ); Thu, 29 Jun 2023 02:45:11 -0400 Received: from out-30.mta1.migadu.com (out-30.mta1.migadu.com [95.215.58.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B96630F1 for ; Wed, 28 Jun 2023 23:42:33 -0700 (PDT) Message-ID: <9ad5f93f-b566-03ec-dba4-1f7777489e29@linux.dev> Date: Thu, 29 Jun 2023 14:42:24 +0800 MIME-Version: 1.0 Subject: Re: [PATCH v3 3/3] blk-mq: fix start_time_ns and alloc_time_ns for pre-allocated rq Content-Language: en-US To: Christoph Hellwig Cc: axboe@kernel.dk, tj@kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, zhouchengming@bytedance.com, ming.lei@redhat.com References: <20230628124546.1056698-1-chengming.zhou@linux.dev> <20230628124546.1056698-4-chengming.zhou@linux.dev> <20230629053201.GF16819@lst.de> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Chengming Zhou In-Reply-To: <20230629053201.GF16819@lst.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On 2023/6/29 13:32, Christoph Hellwig wrote: >> +/* Set rq alloc and start time when pre-allocated rq is actually used */ >> +static inline void blk_mq_rq_time_init(struct request_queue *q, struct request *rq) >> +{ >> + if (blk_mq_need_time_stamp(rq->rq_flags)) { >> + u64 now = ktime_get_ns(); >> + >> +#ifdef CONFIG_BLK_RQ_ALLOC_TIME >> + /* >> + * alloc time is only used by iocost for now, >> + * only possible when blk_mq_need_time_stamp(). >> + */ >> + if (blk_queue_rq_alloc_time(q)) >> + rq->alloc_time_ns = now; >> +#endif >> + rq->start_time_ns = now; >> + } >> +} > > No need to pass q separately here, you can just use rq->q. > > While you're at it please capitalize the first letter of block comments. > Ok, I will use rq->q and fix the comments in the next version. Thanks.