From: SeongJae Park <sj@kernel.org>
To: Bijan Tabatabai <bijan311@gmail.com>
Cc: SeongJae Park <sj@kernel.org>,
damon@lists.linux.dev, linux-mm@kvack.org,
linux-kernel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Bijan Tabatabai <bijantabatab@micron.com>
Subject: Re: [PATCH v2] mm/damon/core: skip needless update of damon_attrs in damon_commit_ctx()
Date: Thu, 7 Aug 2025 09:24:59 -0700 [thread overview]
Message-ID: <20250807162459.52683-1-sj@kernel.org> (raw)
In-Reply-To: <CAMvvPS7mcevjD-b2vz1P+grQfffVA0bx-x5WcUQ8=JApD+UkHw@mail.gmail.com>
On Wed, 6 Aug 2025 19:48:44 -0500 Bijan Tabatabai <bijan311@gmail.com> wrote:
> On Wed, Aug 6, 2025 at 7:19 PM SeongJae Park <sj@kernel.org> wrote:
> >
> > On Wed, 6 Aug 2025 18:42:54 -0500 Bijan Tabatabai <bijan311@gmail.com> wrote:
> >
> > > From: Bijan Tabatabai <bijantabatab@micron.com>
> > >
> > > Currently, damon_commit_ctx() always calls damon_set_attrs() even if the
> > > attributes have not been changed. This can be problematic when the DAMON
> > > state is committed relatively frequently because damon_set_attrs() resets
> > > ctx->next_{aggregation,ops_update}_sis, causing aggregation and ops
> > > update operations to be needlessly delayed.
> > >
> > > This patch avoids this by only calling damon_set_attrs() in
> > > damon_commit_ctx when the attributes have been changed.
> > >
> > > Cc: Bijan Tabatabai <bijan311@gmail.com>
> >
> > Maybe above line is added by a mistake?
>
> Sorry about that. I added it because my internship ends this week and
> wanted to make sure I get notifications on the status of this patch
> (e.g. email notifications when the patch is merged in Andrew's tree).
> If it's inappropriate I will remove it in the next version (unless
> Andrew does it himself).
I was just thinking you might not added this for a purpose. I don't mind
adding this Cc tag. As you may already noticed, Andrew merged this patch as is
with this Cc line, so seems Andrew also doesn't really mind, so all is good.
I hope you had a nice internship and continue seeing on the mailing lists :)
[...]
> > > +static bool damon_attrs_equals(const struct damon_attrs *attrs1,
> > > + const struct damon_attrs *attrs2)
> > > +{
> > > + const struct damon_intervals_goal *ig1 = &attrs1->intervals_goal;
> > > + const struct damon_intervals_goal *ig2 = &attrs2->intervals_goal;
> > > +
> > > + return attrs1->sample_interval == attrs2->sample_interval &&
> > > + attrs1->aggr_interval == attrs2->aggr_interval &&
> > > + attrs1->ops_update_interval == attrs2->ops_update_interval &&
> > > + attrs1->min_nr_regions == attrs2->min_nr_regions &&
> > > + attrs1->max_nr_regions == attrs2->max_nr_regions &&
> > > + ig1->access_bp == ig2->access_bp &&
> > > + ig1->aggrs == ig2->aggrs &&
> > > + ig1->min_sample_us == ig2->min_sample_us &&
> > > + ig1->max_sample_us == ig2->max_sample_us;
> > > +
> >
> > Unnecessary blank line?
>
> Sorry for missing this!
No worry, as you may already noticed, Andrew thankfully fixed this, with a
followup fix patch[1].
So all is well :)
[...]
[1] https://lore.kernel.org/20250807033443.BD30FC4CEEB@smtp.kernel.org
Thanks,
SJ
prev parent reply other threads:[~2025-08-07 16:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-06 23:42 [PATCH v2] mm/damon/core: skip needless update of damon_attrs in damon_commit_ctx() Bijan Tabatabai
2025-08-07 0:19 ` SeongJae Park
2025-08-07 0:48 ` Bijan Tabatabai
2025-08-07 16:24 ` SeongJae Park [this message]
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=20250807162459.52683-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=bijan311@gmail.com \
--cc=bijantabatab@micron.com \
--cc=damon@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/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).