lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMvvPS6hfCRh1fQh5zU5_quswPFVp0zWyS9N-Zikc0K-nSZd_g@mail.gmail.com>
Date: Tue, 5 Aug 2025 20:27:52 -0500
From: Bijan Tabatabai <bijan311@...il.com>
To: SeongJae Park <sj@...nel.org>
Cc: damon@...ts.linux.dev, linux-mm@...ck.org, linux-kernel@...r.kernel.org, 
	linux-doc@...r.kernel.org, Andrew Morton <akpm@...ux-foundation.org>, corbet@....net, 
	Bijan Tabatabai <bijantabatab@...ron.com>
Subject: Re: [PATCH 0/5] mm/damon/sysfs: Add commands useful for using
 migration dests

Hi SJ,


On Tue, Aug 5, 2025 at 7:40 PM SeongJae Park <sj@...nel.org> wrote:
>
> Hi Bijan,
>
> Subjects of patches usually be converted into lowercase when be merged into mm
> tree.  I'd suggest using lowercase even in patches stage, if those aim to be
> merged into mm tree.

Noted, thanks.

[...]
> > The commit_schemes_dests command, similar to the existing
> > commit_schemes_quota_goals, is used to commit only the dests fields of
> > schemes. This has a couple of benefits:
> > 1) It is more efficient than recommitting all the DAMON data.
> > 2) Doing a full commit resets the aggregation and ops_update intervals. If
> > a user sends the full commit command frequently (relatively to those
> > intervals) the aggregation and ops_update events will be prevented from
> > triggering. Having a separate commit command side steps this problem.
>
> I agree the commit command of DAMON sysfs interface is inefficient, and could
> make the infinite intervals delay problem.  But, I didn't expect there could be
> use cases that use commit feature frequently enough to make the inefficiency
> and the intervals delay be real problems.  Could you please let me know more
> details about your use case and how severe problem DAMON is causing?

In my use case, I am trying to optimize the interleave ratio of
applications to maximize their performance without prior knowledge of
their behavior. To do this, we take the steps of updating the ratio,
observing how the system reacts to the change in ratio, and update the
ratio again accordingly. Because we want to approach the ideal
interleave ratio quickly, we update the weights frequently, motivating
the commit_schemes_dests. Similarly, we want to observe how the system
reacts to the change only after the change has been applied,
motivating wait_for_schemes_apply.

The consequences are not very severe. The problem can be worked around
by either updating less frequently, at the cost of converging slower,
or decreasing the maximum aggregation period, which from what I
understand may affect the access monitoring behavior.

> Depending on the real problem, I'm wondering if optimizing commit command can
> be a solution.  For example, skipping the update of next_aggregation_sis and
> next_ops_update_sis when the intervals are not changed might be able to solve
> the intervals delay problem.

This would work for my use case. Another option might be to have a
more general commit_schemes command, which may be useful to other use
cases. I'll defer to your judgement on which would be better.

> >
> > The wait_for_schemes_apply command causes the calling thread to wait until
> > all schemes have been applied. It does this by calling damos_walk() with a
> > NULL walk_fn. This can be useful, for example, if a user wants to know when
> > new scheme parameters they've committed have been applied. Another use case
> > could be if a user wants to record the system state every time a scheme is
> > applied for debuging purposes.
> >
> > The functionality of wait_for_schemes_apply can be achieved with the
> > existing update_schemes_tried_bytes and update_schemes_tried_regions
> > commands. However, having a separate command avoids extra work and makes
> > user intent clearer when used in scripts.
>
> I agree extra works are always better to be avoided.  But is the overhead large
> enough to be a real problem for your use case?  I also agree it could make the
> user script cleaner, but adding a kernel feature only for user scripts
> readabilities sounds like too much, since the user script could have its own
> abstract layers for its readability.

Totally fair. I will drop wait_for_apply_schemes in any future versions.

> Also, even if the new command is implemented, since the DAMOS schemes continue
> running, the system status will keep changing.  If you cannot do the recording
> of the system state in a restricted time, the recorded information might not be
> that reliable.  So I'm not sure if you really need this strict waiting in this
> way.

Fair. That was not something I was personally using the command for,
just another possible use case I thought of. Regardless of the
usefulness of that, the existing commands using damos_walk would work
well enough.

> Could you please share more details about what you want to do with the new
> command, and how much problem you are seeing?  I'm particularly curious what
> system state you want to record, and why you need to wait the exact time
> interval.

I mentioned this above, but I am using this to wait for new migration
weights to be applied before monitoring how the change affects
applications, but again, this can be done with existing commands.

Thanks for your response,
Bijan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ