From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B11E2C433F5 for ; Tue, 12 Oct 2021 09:37:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3DD82603E9 for ; Tue, 12 Oct 2021 09:37:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3DD82603E9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id ADB20900002; Tue, 12 Oct 2021 05:37:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A89F56B0071; Tue, 12 Oct 2021 05:37:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 95172900002; Tue, 12 Oct 2021 05:37:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0149.hostedemail.com [216.40.44.149]) by kanga.kvack.org (Postfix) with ESMTP id 8917D6B006C for ; Tue, 12 Oct 2021 05:37:33 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 279A030141 for ; Tue, 12 Oct 2021 09:37:33 +0000 (UTC) X-FDA: 78687282786.23.8658B39 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf15.hostedemail.com (Postfix) with ESMTP id C14A4D004740 for ; Tue, 12 Oct 2021 09:37:32 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 4154660F92; Tue, 12 Oct 2021 09:37:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634031451; bh=R0SmQ7S/jRl0PK0hlJ5/R750VuqmT/FeDVno38hWDr4=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=mzfCcpVr8ALhVHoZHgieujKeAdV8tmt7NBQGrjgmA2ROwdKxQFfT3Ob98rwChUpQ6 E8nSFfPCYteYGrh7NtHRnhJEwQxknS0aujyJaMuDxemmJeonhN1d/OtEHmaRsySFty q4v0DqOtNxUKfmSdv5F+JUx1eywsK7+4giQiX6abGn6vgYqE6vSuHdeQLd6w3Qx28L KqJ1BlWlh1DfEoY02cX/4+VOwk0oOhSnwDEdw479bMmesw981ubORAL/iHR1SzrLRR sPSJoEgJ8TlNHyCELfCdO9SOJrfoFQd+uLF/rEI/EtprWutRyEPd+dUoymHB8GA/o6 yzOJJXso1BvGA== From: SeongJae Park To: Xin Hao Cc: SeongJae Park , sjpark@amazon.de, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/damon/dbgfs: add region_stat interface Date: Tue, 12 Oct 2021 09:37:26 +0000 Message-Id: <20211012093726.33014-1-sj@kernel.org> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 In-Reply-To: <7ab062d3-f087-78ef-4630-471bb6d16275@linux.alibaba.com> Content-Type: text/plain; charset=UTF-8 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: C14A4D004740 X-Stat-Signature: 8rtkt8b5xyj95fi55kuja38mxpwthk5y Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=mzfCcpVr; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf15.hostedemail.com: domain of sj@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=sj@kernel.org X-HE-Tag: 1634031452-65786 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, 12 Oct 2021 15:57:17 +0800 Xin Hao wrote= : >=20 > =E5=9C=A8 2021/10/12 =E4=B8=8B=E5=8D=883:11, SeongJae Park =E5=86=99=E9= =81=93: > > Hello Xin, thank you for this patch! > > > > On Tue, 12 Oct 2021 13:49:48 +0800 Xin Hao w= rote: > > > >> Using damon-dbgfs has brought great convenience to user-mode > >> operation damon, but sometimes if i want to be able to view > >> the division of task regions, nr_access values etc,but i found > >> that it is impossible to view directly through the dbgfs interface, > >> so there i add a interface "region_stat", it displays like this. > >> > >> # cat region_stat > >> last_aggregation=3D120.87s > >> target_id=3D5148 > >> nr_regions=3D10 > >> 400000-258c000(34352 KiB): 1 > >> 258c000-4719000(34356 KiB): 0 > >> 4719000-abbf000(103064 KiB): 0 > >> abbf000-c4d4000(25684 KiB): 11 > >> c4d4000-ff5c000(59936 KiB): 15 > >> ff5c000-152f9000(85620 KiB): 20 > >> 152f9000-1599e000(6804 KiB): 10 > >> 1599e000-19573000(61268 KiB): 0 > >> 19573000-1f92c000(102116 KiB): 0 > >> 1f92c000-22a4c000(50304 KiB): 0 > > I think similar information could also be collected via the 'damon_ag= gregated' > > tracepoint[1], which is merged in the mainline, or 'DAMOS_STAT'[2], w= hich is > > merged in -mm. The recording feature[3] could also be used, though i= t would > > take some time before it is merged in the mainline. Have you conside= red using > > those but found some problem? >=20 > Yes, i know we can use damon_aggregated tracepoint, but i think, add a=20 > "region_stat" will be more >=20 > convenient and intuitive, especially when we use damon-dbgfs interface. Thanks for the answer. For more conveniend and intuitive interfaces, I recommend DAMON user-sapc= e tool[1] rather than the debugfs interface. You can also implement your o= wn user-space tool on top of the debugfs interface. For example, the refere= nce implementation[1] implements 'record' feature on top of the tracepoint. = The feature can provide below information, which is quite similar to what you= want. For more information on this, please refer to the document[2]. # damo record $(pidof $workload) # damo report raw base_time_absolute: 8 m 59.809 s monitoring_start: 0 ns monitoring_end: 104.599 ms monitoring_duration: 104.599 ms target_id: 18446623438842320000 nr_regions: 3 563ebaa00000-563ebc99e000( 31.617 MiB): 1 7f938d7e1000-7f938ddfc000( 6.105 MiB): 0 7fff66b0a000-7fff66bb2000( 672.000 KiB): 0 monitoring_start: 104.599 ms monitoring_end: 208.590 ms monitoring_duration: 103.991 ms target_id: 18446623438842320000 nr_regions: 4 563ebaa00000-563ebc99e000( 31.617 MiB): 1 7f938d7e1000-7f938d9b5000( 1.828 MiB): 0 7f938d9b5000-7f938ddfc000( 4.277 MiB): 0 7fff66b0a000-7fff66bb2000( 672.000 KiB): 5 If this is still not so useful for you, could you please elaborate more o= n your detailed requirements and use cases? [1] https://github.com/awslabs/damo [2] https://github.com/awslabs/damo/blob/next/USAGE.md#raw Thanks, SJ >=20 > > > > [1] https://git.kernel.org/torvalds/c/2fcb93629ad8 > > [2] https://lore.kernel.org/linux-mm/20211001125604.29660-6-sj@kernel= .org/ > > [3] https://lore.kernel.org/linux-mm/20211008094509.16179-1-sj@kernel= .org/ > > > > > > Thanks, > > SJ > > > > [...] >=20 > --=20 > Best Regards! > Xin Hao