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: <20250806004003.52864-1-sj@kernel.org>
Date: Tue,  5 Aug 2025 17:40:03 -0700
From: SeongJae Park <sj@...nel.org>
To: Bijan Tabatabai <bijan311@...il.com>
Cc: SeongJae Park <sj@...nel.org>,
	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 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.

On Tue,  5 Aug 2025 11:20:17 -0500 Bijan Tabatabai <bijan311@...il.com> wrote:

> From: Bijan Tabatabai <bijantabatab@...ron.com>
> 
> This patchset adds two DAMON commands, commit_schemes_dests and
> wait_for_schemes_apply, that I have found useful for using a migrate_hot
> scheme with migration dests.

Thank you for this patchset!  I believe we shouldn't be afraid at adding
features, but should also be carefult at making good solutions for real
problems.  So, my main response to this patchset is, hopefully unsurprisingly,
I'd like to better understand the requirements and the problem you are
encountering.

> 
> 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?

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.

> 
> 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.

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.

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.

Depending on the real use case and the problem, I think we might be able to
reuse the DAMOS scheme stats, or implement more strict and reliable time
control features, say, making kdamond or schemes pause and resume as users ask?


Thanks,
SJ

[...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ