Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp8072540rdb; Thu, 4 Jan 2024 18:50:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IGjHfAxIjZyjGyIHDDZQYqdPb3iGm7knN4ImfzZNRUwUFxFOG5Qx/7abhy5IQB3nTyDueNp X-Received: by 2002:a05:622a:14f:b0:429:74f2:24cd with SMTP id v15-20020a05622a014f00b0042974f224cdmr903343qtw.71.1704423003676; Thu, 04 Jan 2024 18:50:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704423003; cv=none; d=google.com; s=arc-20160816; b=y0vLZ3Jiwr1y622U4+crnnqJbD69GuCjkjh9RRBK1Ky2RZj9t5YAzG6HxePBnOUFL+ oRf7DJLnWtlE/bLEFDXheoWy/Ib3wvuhTEttnWuh8EayxABCa17RzRuoDIo4IJ03NMkc qYmJaIHkEIsiY6YFDV2ahZHKV+nesdLjDkRCc12eSYQwPwkPsxCqR0As6WuBNccKhk7j pXUhDfw3txzE8UvLArtr6Ezz0hnNTaT3myqBrbUT9/10tnTNijHw9r83L3NFeDIJoq/u eGJ/v3/7X+4QuszxlIYVGJAGlKyIwsjgYJavBt0b/NvFdJ/pHSHhcm4vK7Mh5mF97LKG yJAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=8kHYrItYGiAQsYKD5ffJYn6ZPwoCN+6n7GbgnD9P3fo=; fh=Dj6bZU10rWEkaJ8QA4oUlMmNGrkUKfbGsp3mVuXMQO4=; b=pfP+5Yo7UFrCOudSYV3VcXrFGv9EZCr868S9e++QGHZmG8CKiejhZ+NYThYNvw905V K8tVPd9W5xMEPb7nzdtqCqTUXRfygy8h2cnz18JBBLot6Nyqa8JWZNB7qToRBBBawAxc Crz1voSvhVGzo3B2bmRWEf1O6HjbhYKoE54g0HCk/mwzo6hhPkUDwpaTgT9QB058NjBv CoM6nVuaRu9MlC8YYQ9CqoEfnXuJD8slJs5w5wHVXIzg/TZh7i1vGkzRm3I8t9VuU8JV c5YWmCEfvL8Ar1KZwT1DqBB2Awsla8Z/PAgNlWOf63olqLbR8TnUpVFEeRSQ/A60nmHK N1Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ea8f5tm9; spf=pass (google.com: domain of linux-kernel+bounces-17439-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17439-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id o12-20020ac87c4c000000b0042617bd355dsi906139qtv.725.2024.01.04.18.50.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 18:50:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17439-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ea8f5tm9; spf=pass (google.com: domain of linux-kernel+bounces-17439-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17439-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 5C8881C22A25 for ; Fri, 5 Jan 2024 02:49:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3BD31440E; Fri, 5 Jan 2024 02:49:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ea8f5tm9" X-Original-To: linux-kernel@vger.kernel.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0006920EE for ; Fri, 5 Jan 2024 02:49:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704422988; 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: in-reply-to:in-reply-to:references:references; bh=8kHYrItYGiAQsYKD5ffJYn6ZPwoCN+6n7GbgnD9P3fo=; b=ea8f5tm9Kb1VGDgKOP7vP1qMl3zaRyUmBBL01XE1wik9aIVfMJi9UbNpAj/GLYcTl7HWER BLSwmUlnOXMYM5DKLDBuYLC9bwaysDeAxJ0PyakmWL7IGHMjUDkuhCrWwRWqXAOCHAslXK uNJ93M4GXMySpRQt1dAoyUIhjQeV9tU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-631-_laBTFaEPmOb3xHH_6Ruxg-1; Thu, 04 Jan 2024 21:49:43 -0500 X-MC-Unique: _laBTFaEPmOb3xHH_6Ruxg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 38F7783BA82; Fri, 5 Jan 2024 02:49:43 +0000 (UTC) Received: from fedora (unknown [10.72.116.136]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 992CD3C25; Fri, 5 Jan 2024 02:49:38 +0000 (UTC) Date: Fri, 5 Jan 2024 10:49:34 +0800 From: Ming Lei To: Yu Kuai Cc: hch@lst.de, bvanassche@acm.org, axboe@kernel.dk, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yukuai3@huawei.com, yi.zhang@huawei.com, yangerkun@huawei.com Subject: Re: [PATCH for-6.8/block RFC v2] block: support to account io_ticks precisely Message-ID: References: <20240103071515.2477311-1-yukuai1@huaweicloud.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240103071515.2477311-1-yukuai1@huaweicloud.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 On Wed, Jan 03, 2024 at 03:15:15PM +0800, Yu Kuai wrote: > From: Yu Kuai > > Currently, io_ticks is accounted based on sampling, specifically > update_io_ticks() will always account io_ticks by 1 jiffies from > bdev_start_io_acct()/blk_account_io_start(), and the result can be > inaccurate, for example(HZ is 250): > > Test script: > fio -filename=/dev/sda -bs=4k -rw=write -direct=1 -name=test -thinktime=4ms > > Test result: util is about 90%, while the disk is really idle. > > In order to account io_ticks precisely, update_io_ticks() must know if > there are IO inflight already, and this requires overhead slightly, > hence precise io accounting is disabled by default, and user can enable > it through sysfs entry. > > Noted that for rq-based devcie, part_stat_local_inc/dec() and > part_in_flight() is used to track inflight instead of iterating tags, > which is not supposed to be used in fast path because 'tags->lock' is > grabbed in blk_mq_find_and_get_req(). > > Signed-off-by: Yu Kuai > --- > Changes in v2: > - remove the new parameter for update_io_ticks(); > - simplify update_io_ticks(); > - use swith in queue_iostats_store(); > - add missing part_stat_local_dec() in blk_account_io_merge_request() Looks fine, Reviewed-by: Ming Lei thanks, Ming