Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp20233315rwd; Wed, 28 Jun 2023 22:39:35 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ67giSahEhgBixM+3rsFTBXXVVYNwX4rlhU/B2K12TkL8uSiiN4J2KXNwCwgPXnn/4tNcWW X-Received: by 2002:a05:6808:18a7:b0:3a1:e282:8405 with SMTP id bi39-20020a05680818a700b003a1e2828405mr12758100oib.13.1688017174891; Wed, 28 Jun 2023 22:39:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688017174; cv=none; d=google.com; s=arc-20160816; b=xWbFe1JBVzeS4Gpjs1bqm8bSegpGTMZNAk63r5wQhQoShSJ31tbezSew5KC5ZCtNlP DkmyVLv5R4E2rhZIpmmKND5Q5Z3cDrSfm4OLe1wkMmQnLW37wN+MrrEc1y1Qg9N6Ny7Z s63B4tDOW+q1IlfPwr22Sq4NLb4t192azK+lFC+8UYjHpsotJmzbvFCv1vnn8NenSRY2 hANb6KGJ6Qoi+NhXqRRfFOkhUTr9iACJELWUGtmt2HHRGURxPsuezUJoZdUBFIhNuvcj LPBcIpII9T3xX4Cqg5M4OmBMrzU2P5FWDNZjj1GkrED/gWKUlZs7C8YSPi/C5piNoPg1 50NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=bgjKzfVjKrdvXu8WMycrGNHHoNhlrCyDTPDaRg6kpdY=; fh=iChqycO94i+29x6EoAetvZ/likV1mfVc1yM/rwDPEvg=; b=aq6zLaumqZCYZrPB+jIDDmUTgYLQKFQvP5m/3nyR3xbqp1YXB15ixmj6Jna+mZWB0P h11B4NOREYcIjkxdStMufQ1KIyrfQKQhPjbqSTaTaCFWqMP4DVjgUMDpZSEEO7RDQVaR QRzTAzedGnpdo3h5XdWo+oCqTWN+DXA/Rh7sH2Sv4cnQ93sJt6uGfBapLwG+dJXpsZu2 eNxjFeBC7/HDoKwk1ZUnIPmGC5a0zwnhRNHzZgWh+JFEH7rRpQ0BUPZSguL4pDuDJVqs sY3V3umn5FdvtJJD3CZ2tWwG8SHmixmLOyDGCwimENnSOOFlQy8U4PfzaBF0GffXsIYZ ezRQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v9-20020a056a00148900b0066243798ac3si10050386pfu.278.2023.06.28.22.39.22; Wed, 28 Jun 2023 22:39:34 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231446AbjF2FcN (ORCPT + 99 others); Thu, 29 Jun 2023 01:32:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229624AbjF2FcG (ORCPT ); Thu, 29 Jun 2023 01:32:06 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B129C1BE8; Wed, 28 Jun 2023 22:32:05 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 2102F67373; Thu, 29 Jun 2023 07:32:02 +0200 (CEST) Date: Thu, 29 Jun 2023 07:32:01 +0200 From: Christoph Hellwig To: chengming.zhou@linux.dev Cc: axboe@kernel.dk, tj@kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, zhouchengming@bytedance.com, ming.lei@redhat.com, hch@lst.de Subject: Re: [PATCH v3 3/3] blk-mq: fix start_time_ns and alloc_time_ns for pre-allocated rq Message-ID: <20230629053201.GF16819@lst.de> References: <20230628124546.1056698-1-chengming.zhou@linux.dev> <20230628124546.1056698-4-chengming.zhou@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230628124546.1056698-4-chengming.zhou@linux.dev> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,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 > +/* 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.