Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp248334rwb; Tue, 6 Dec 2022 20:32:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf4i88d8+buDDyt/lGkiug34hj5R09JgWDjJZ9EfIck5Rd1WqZ/HoMBCA0DLJZ/dlK2s4sx5 X-Received: by 2002:a17:902:b117:b0:189:e426:4635 with SMTP id q23-20020a170902b11700b00189e4264635mr8918581plr.46.1670387565896; Tue, 06 Dec 2022 20:32:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670387565; cv=none; d=google.com; s=arc-20160816; b=PT5cktOlMQ4wzF7XoMfNQSv/shwKeZ1krjbFOGjUpMbOYTfJE8x8LAMCaFCXEP6loI N+e+/ARKIANi3ncz2P5ic1mUxYGpsdaNIbYyG3lkdUPupfPLoocbzvbjB3YKBBRX1gie 3M9K4rypzz6dabVPG7peNGEGTej0+RhPZJePOOE3XSUTX+9ehcJXYB6izhGBkYLxO6NG svky7jZKhk9mFukxRv5smz5eecRbPIoipMzq4eyKmSi6hfNtRmIee4YG37Tb426y8Hqo ZGW3bfBJJqPhFI3BYij7nggz4gjgfHzaDs+wsGu/fPyKNAcdGOYdEMwVX1W2Aw0xb3RP wMIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=faTdYvtAe2NMddrehpXs2XQgPcQu3OATzJcZ1A/nsDA=; b=uhodyWaWaabX/kFeZCH6RP+Egm2LRyjLN8wW1mbkzzHEuHX51h1R1r7ZoAnr8/WIpm Bl9NuSCuZ6fFsgQ4Lla+jlZV6FRZFOQUa+JKVPphUAN5i/IsZLk5G//E6UXdAZlqgJT1 zwiJlKgL2xn+tBnXe9ZGOXkg/INL1JUz+OAyBw0faVYh8NW0xknjkyWI/cAuHFLiLi/y m47oRqDLoKBk7Mt5hnv5R9jxw2veSQCo53aVfQI+ZMcId3DI72S+tmuB3+EE2JlT0NLu U3p/s0mblKl/b0eD0je2QNL8wZ4VOaA0078pghL98ss0eQYZ3oDF1TwwNVGalm+ADzpw lZwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Kem0Nx3V; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d5-20020a056a0010c500b0053e8d0c9909si20776921pfu.221.2022.12.06.20.32.35; Tue, 06 Dec 2022 20:32:45 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=Kem0Nx3V; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229751AbiLGDRH (ORCPT + 77 others); Tue, 6 Dec 2022 22:17:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbiLGDRG (ORCPT ); Tue, 6 Dec 2022 22:17:06 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 582A9554CC for ; Tue, 6 Dec 2022 19:16:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670382970; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=faTdYvtAe2NMddrehpXs2XQgPcQu3OATzJcZ1A/nsDA=; b=Kem0Nx3VcKYrz2QF4re6j/kWYICkrzdu15Sh8ACzC0dm/vupMmMNqpZuUaVqpk+D+HdXRy oA8LJuZZs1QHP142FMvQ166vxjcV7yVNueTZLC/JtWGL5nX6CVzU6ze/k8r7qm0dPVjIOZ uB9pLBjIY+GJD6r+j0uMXeNMx33W6go= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-52-qPbK1vmPPgSMR5tC6UfxoA-1; Tue, 06 Dec 2022 22:16:07 -0500 X-MC-Unique: qPbK1vmPPgSMR5tC6UfxoA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C3F5C811E67; Wed, 7 Dec 2022 03:16:05 +0000 (UTC) Received: from T590 (ovpn-8-16.pek2.redhat.com [10.72.8.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A29517AE5; Wed, 7 Dec 2022 03:15:49 +0000 (UTC) Date: Wed, 7 Dec 2022 11:15:43 +0800 From: Ming Lei To: Yu Kuai Cc: Gulam Mohamed , linux-block@vger.kernel.org, axboe@kernel.dk, philipp.reisner@linbit.com, lars.ellenberg@linbit.com, christoph.boehmwalder@linbit.com, minchan@kernel.org, ngupta@vflare.org, senozhatsky@chromium.org, colyli@suse.de, kent.overstreet@gmail.com, agk@redhat.com, snitzer@kernel.org, dm-devel@redhat.com, song@kernel.org, dan.j.williams@intel.com, vishal.l.verma@intel.com, dave.jiang@intel.com, ira.weiny@intel.com, junxiao.bi@oracle.com, martin.petersen@oracle.com, kch@nvidia.com, drbd-dev@lists.linbit.com, linux-kernel@vger.kernel.org, linux-bcache@vger.kernel.org, linux-raid@vger.kernel.org, nvdimm@lists.linux.dev, konrad.wilk@oracle.com, "yukuai (C)" Subject: Re: [RFC] block: Change the granularity of io ticks from ms to ns Message-ID: References: <20221206181536.13333-1-gulam.mohamed@oracle.com> <936a498b-19fe-36d5-ff32-817f153e57e3@huaweicloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <936a498b-19fe-36d5-ff32-817f153e57e3@huaweicloud.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 On Wed, Dec 07, 2022 at 10:19:08AM +0800, Yu Kuai wrote: > Hi, > > 在 2022/12/07 2:15, Gulam Mohamed 写道: > > Use ktime to change the granularity of IO accounting in block layer from > > milli-seconds to nano-seconds to get the proper latency values for the > > devices whose latency is in micro-seconds. After changing the granularity > > to nano-seconds the iostat command, which was showing incorrect values for > > %util, is now showing correct values. > > This patch didn't correct the counting of io_ticks, just make the > error accounting from jiffies(ms) to ns. The problem that util can be > smaller or larger still exist. Agree. > > However, I think this change make sense consider that error margin is > much smaller, and performance overhead should be minimum. > > Hi, Ming, how do you think? I remembered that ktime_get() has non-negligible overhead, is there any test data(iops/cpu utilization) when running fio or t/io_uring on null_blk with this patch? Thanks, Ming