Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1035778pxu; Wed, 16 Dec 2020 23:59:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJzfR3HSgN5Pti4Oz1/g8GX2mtivaM9OD/OEGRy/mt/GC5ifGy0hXxHibNySrmH4bKWwQ9Ep X-Received: by 2002:a17:906:b793:: with SMTP id dt19mr33969306ejb.120.1608191948775; Wed, 16 Dec 2020 23:59:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608191948; cv=none; d=google.com; s=arc-20160816; b=JBkPe51YQfMkZOeJgiKTglaLS9RiigwNAxChsuq1uaaRGLeDeHI48lXXM7P4aux/9/ 7mVCsih4l5sgV7neX9xSA5tIUV/nz6b5h3xim7BQOCECzdaE4SiDHnSumqqKzccgFnjW QA2A8Iii8jVzu1BzZL1KQCdhyKvP2hSXAmOok0nN3WpYfxba+iI3Hp8apjVb5wUh39zF WbLdRl4nWiqw90U6Nrfard7xdE9Wzopk9KEKEgMUfwSatKnpSrayPEFmV1sbMjIN9VLq x3aM8rguIuXL5FUJIECUsLnH/htxpeC0UnwUuA9q9wDocliJE5BI7LcSmN/j23q7E0wW 4BkQ== 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 :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=GQFEFtaRBizXgv1y2qK/tLBdc9eMiLL26jiVKwzeUB8=; b=QTmx1vmFevtul0wZwcDOKbpridyL+HbOm2w/SDXWZ0ylJyC51Sl9y/r5MVmdZeoNXU 7B4nO46jZc3jiP8C6epX9H4kLZRLTihJPq63GJ84eMj3DAWO+XxZSmNCe5RbnzOoFEgh NmP7aP23UdLjkCG95TOTzXBmWNAWinqFSHxzSlM7QnssNDoLF1l3O64jPsxngIPXpPjC K1UGH46O5+e6lu/fUpBLWFeYhHHWohLpWIKPM1ZxwKAd5jEJstwjc89E1vC+H+fpmoeW RYNtv2viKFXjKAwyDSGAS16VUG0+IE8LhrzAZHKmt50B64FdiUVQN91mUIdFWO4wRwS+ 4jDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d3si3897817edo.149.2020.12.16.23.58.46; Wed, 16 Dec 2020 23:59:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726841AbgLQH6M (ORCPT + 99 others); Thu, 17 Dec 2020 02:58:12 -0500 Received: from out30-133.freemail.mail.aliyun.com ([115.124.30.133]:39352 "EHLO out30-133.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726613AbgLQH6M (ORCPT ); Thu, 17 Dec 2020 02:58:12 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0UIuR5Z9_1608191844; Received: from 30.21.164.59(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0UIuR5Z9_1608191844) by smtp.aliyun-inc.com(127.0.0.1); Thu, 17 Dec 2020 15:57:25 +0800 Subject: Re: [PATCH 1/2] blk-iocost: Add iocg idle state tracepoint To: axboe@kernel.dk, tj@kernel.org Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org References: <1ba7a38d5a6186b1e71432ef424c23ba1904a365.1607591591.git.baolin.wang@linux.alibaba.com> From: Baolin Wang Message-ID: <3aa9c1a1-5640-b60c-4fab-22ee7de40539@linux.alibaba.com> Date: Thu, 17 Dec 2020 15:57:24 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <1ba7a38d5a6186b1e71432ef424c23ba1904a365.1607591591.git.baolin.wang@linux.alibaba.com> Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jens, > It will be helpful to trace the iocg's whole state, including active and > idle state. And we can easily expand the original iocost_iocg_activate > trace event to support a state trace class, including active and idle > state tracing. > > Signed-off-by: Baolin Wang Could you pick up patch 1 which was already acked by Tejun. Thanks. > --- > block/blk-iocost.c | 3 +++ > include/trace/events/iocost.h | 16 +++++++++++++++- > 2 files changed, 18 insertions(+), 1 deletion(-) > > diff --git a/block/blk-iocost.c b/block/blk-iocost.c > index ffa418c..ac6078a 100644 > --- a/block/blk-iocost.c > +++ b/block/blk-iocost.c > @@ -2185,6 +2185,9 @@ static int ioc_check_iocgs(struct ioc *ioc, struct ioc_now *now) > WEIGHT_ONE); > } > > + TRACE_IOCG_PATH(iocg_idle, iocg, now, > + atomic64_read(&iocg->active_period), > + atomic64_read(&ioc->cur_period), vtime); > __propagate_weights(iocg, 0, 0, false, now); > list_del_init(&iocg->active_list); > } > diff --git a/include/trace/events/iocost.h b/include/trace/events/iocost.h > index 0b68699..e282ce0 100644 > --- a/include/trace/events/iocost.h > +++ b/include/trace/events/iocost.h > @@ -11,7 +11,7 @@ > > #include > > -TRACE_EVENT(iocost_iocg_activate, > +DECLARE_EVENT_CLASS(iocost_iocg_state, > > TP_PROTO(struct ioc_gq *iocg, const char *path, struct ioc_now *now, > u64 last_period, u64 cur_period, u64 vtime), > @@ -59,6 +59,20 @@ > ) > ); > > +DEFINE_EVENT(iocost_iocg_state, iocost_iocg_activate, > + TP_PROTO(struct ioc_gq *iocg, const char *path, struct ioc_now *now, > + u64 last_period, u64 cur_period, u64 vtime), > + > + TP_ARGS(iocg, path, now, last_period, cur_period, vtime) > +); > + > +DEFINE_EVENT(iocost_iocg_state, iocost_iocg_idle, > + TP_PROTO(struct ioc_gq *iocg, const char *path, struct ioc_now *now, > + u64 last_period, u64 cur_period, u64 vtime), > + > + TP_ARGS(iocg, path, now, last_period, cur_period, vtime) > +); > + > DECLARE_EVENT_CLASS(iocg_inuse_update, > > TP_PROTO(struct ioc_gq *iocg, const char *path, struct ioc_now *now, >