From: SeongJae Park <sj@kernel.org>
To: Xin Hao <xhao@linux.alibaba.com>
Cc: sjpark@amazon.de, akpm@linux-foundation.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH V1 2/2] mm/damon: Add 'age' of region tracepoint support
Date: Wed, 10 Nov 2021 13:16:21 +0000 [thread overview]
Message-ID: <20211110131621.18221-1-sj@kernel.org> (raw)
In-Reply-To: <df8d52f1fb2f353a62ff34dc09fe99e32ca1f63f.1636546262.git.xhao@linux.alibaba.com>
On Wed, 10 Nov 2021 20:13:14 +0800 Xin Hao <xhao@linux.alibaba.com> wrote:
> In patch "mm/damon: add a tracepoint", it adds a
> tracepoint for DAMON, it can monitor each region
> for each aggregation interval, Now the region add
> a new 'age' variable, some primitive would calculate
> the priority of each region as a weight, there put it
> into tracepoint, so we can easily track the change of
> its value through perf or damon-tools.
DAMON calculates the age using the address range and nr_accesses of the region,
which are already in the tracepoint. In other words, user space can calculate
the age on their own. Therefore I thought putting age in the tracepoint as
adding unnecessary information, at the moment of the implementation.
Of course, I would missing some use cases that need this information in the
tracepoint. Furthermore, adding just one more value in the tracepoint wouldn't
incur a real issue. But, I'd like to know why this is necessary and how much
benefit it provides. Xin, could you please share that?
Thanks,
SJ
>
> Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
> ---
> include/trace/events/damon.h | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/include/trace/events/damon.h b/include/trace/events/damon.h
> index 2f422f4f1fb9..99ffa601e351 100644
> --- a/include/trace/events/damon.h
> +++ b/include/trace/events/damon.h
> @@ -22,6 +22,7 @@ TRACE_EVENT(damon_aggregated,
> __field(unsigned long, start)
> __field(unsigned long, end)
> __field(unsigned int, nr_accesses)
> + __field(unsigned int, age)
> ),
>
> TP_fast_assign(
> @@ -30,11 +31,13 @@ TRACE_EVENT(damon_aggregated,
> __entry->start = r->ar.start;
> __entry->end = r->ar.end;
> __entry->nr_accesses = r->nr_accesses;
> + __entry->age = r->age;
> ),
>
> - TP_printk("target_id=%lu nr_regions=%u %lu-%lu: %u",
> + TP_printk("target_id=%lu nr_regions=%u %lu-%lu: %u %u",
> __entry->target_id, __entry->nr_regions,
> - __entry->start, __entry->end, __entry->nr_accesses)
> + __entry->start, __entry->end,
> + __entry->nr_accesses, __entry->age)
> );
>
> #endif /* _TRACE_DAMON_H */
> --
> 2.31.0
next prev parent reply other threads:[~2021-11-10 13:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-10 12:13 [PATCH V1 0/2] mm/damon: Do some small changes Xin Hao
2021-11-10 12:13 ` [PATCH V1 1/2] mm/damon: Unified access_check function naming rules Xin Hao
2021-11-10 12:59 ` SeongJae Park
2021-11-10 12:13 ` [PATCH V1 2/2] mm/damon: Add 'age' of region tracepoint support Xin Hao
2021-11-10 13:16 ` SeongJae Park [this message]
2021-11-11 2:04 ` Xin Hao
2021-11-11 8:20 ` SeongJae Park
2021-11-11 8:29 ` Xin Hao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211110131621.18221-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=sjpark@amazon.de \
--cc=xhao@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).