From patchwork Mon Jun 26 05:04:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengming Zhou X-Patchwork-Id: 11277 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp7251055vqr; Sun, 25 Jun 2023 22:06:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7TFNiu1l7T6auoPJc/GqJRGApaxm6+Fami3pUVV09+JcmVeqYf0HevYSzggAH2qfYN8kq9 X-Received: by 2002:a17:90b:390a:b0:262:f550:6413 with SMTP id ob10-20020a17090b390a00b00262f5506413mr1989885pjb.6.1687756015461; Sun, 25 Jun 2023 22:06:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687756015; cv=none; d=google.com; s=arc-20160816; b=TO5rv2c+cW+Tqq9CyrBTjFNfNye822vMQwBv0i23wUv87TSXDlwYL+O5+s/jcv0CZE BHGn7AXaH962xhSgBnbi4oOlzGbZOZEZaztbcqDvDKrLan+DJEOkd7RoUrJ3/aZr7DGg ithsKjTJhQXWvvX9hRnCbkzueuVhhU9WI7n530NJev8plOGCff5FGlrjCXmU3IFGPEsp S2cKe/f0o/qEAqj3D0mqj5MfRXVeqPmg6iG6jKHh4kvhUJDmYtZrArds64hyl21fpWZf RPkpXjFJXOGku43Q8rH69a8vtwBdfllPGDqoAnx5o0sCyGFV5T/uJVErYVBSyw9ernwT lw+g== 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=JXf0Q/S3gf4ovedHaky94f5Srw5Lfa2v9EFqdiD33dU=; fh=s+7/nupwQZ4a1QHaVvuQwq8RXVZrSOTBv0qS15WToQk=; b=HcJ6wf8VLGpOfCpEHNYxkWbKLxnHNnsR25ldGxy3f+lgMpzI81+YrMj/9CZiVukocK uLKG0ZEYDisY2awQuJnCOlSa0OHoRx6y9tBBz10zjuKqw+JTIVq533fxnLsqTjS9gTOm bTeG2HyxEwgFTra1OjCPraqUlrrKPiH9ji/M6DlIr3vay92gNRmA9IOuwaQqXl23XTqu +HLpdbc55t4Yt4JDbRBXTiUgCgozxHX6tFADh64XIJ7Ztcq2xQJ8rP8nREPN5M7zIvzg 9yQWfVI5R3JXEuozDPMKvJ0R+AQ/VJ3r5v5LFZnVSgJjF4zgOt5MQcWGpoCOZofbXX58 XMdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="Mbcyg0M/"; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 15-20020a17090a190f00b0025e8b44763esi4555257pjg.59.2023.06.25.22.06.39; Sun, 25 Jun 2023 22:06:55 -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="Mbcyg0M/"; 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 S229516AbjFZFGC (ORCPT + 99 others); Mon, 26 Jun 2023 01:06:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229454AbjFZFGA (ORCPT ); Mon, 26 Jun 2023 01:06:00 -0400 Received: from out-62.mta0.migadu.com (out-62.mta0.migadu.com [91.218.175.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDFC6FF for ; Sun, 25 Jun 2023 22:05:58 -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=1687755955; 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=JXf0Q/S3gf4ovedHaky94f5Srw5Lfa2v9EFqdiD33dU=; b=Mbcyg0M/BOvzWY5DvqihhLj92CfaSJPrcEF6ovbhqH+GzwFzS9cGIaSIh8ruYrjCBz/WFm rvCiNgcBAJ2IvvylKyFwGEGKtVRh1it5h4ohkBR5i+FsuDrTFaaATUBahmbDSjd6MtBmVQ IrN7UDIdg4huRlP4MV3u5mjGuYXVavY= 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 Subject: [PATCH v2 0/3] blk-mq: fix start_time_ns and alloc_time_ns for pre-allocated rq Date: Mon, 26 Jun 2023 13:04:02 +0800 Message-Id: <20230626050405.781253-1-chengming.zhou@linux.dev> MIME-Version: 1.0 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=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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769740451704387189?= X-GMAIL-MSGID: =?utf-8?q?1769740451704387189?= From: Chengming Zhou Hello, This patchset is the updated version of [1], which fix start_time_ns and alloc_time_ns for pre-allocated rq. patch 1 and 2 is preparation that we ktime_get_ns() only once 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. [1] 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 | 89 ++++++++++++++++++++++++------------------ include/linux/blk-mq.h | 6 +-- 2 files changed, 55 insertions(+), 40 deletions(-)