linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: SeongJae Park <sj@kernel.org>, Yunjeong Mun <yunjeong.mun@sk.com>,
	damon@lists.linux.dev, kernel-team@meta.com,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: [PATCH 0/2] mm/damon/sysfs: fix refresh_ms control overwriting on multi-kdamonds usages
Date: Mon,  8 Sep 2025 13:15:11 -0700	[thread overview]
Message-ID: <20250908201513.60802-1-sj@kernel.org> (raw)

Automatic esssential DAMON/DAMOS status update feature of DAMON sysfs
interface (refresh_ms) is broken [1] for multiple DAMON contexts
(kdamonds) use case, since it uses a global single damon_call_control
object for all created DAMON contexts.  The fields of the object,
particularly the list field is over-written for the contexts and it
makes unexpected results including user-space hangup and kernel crashes
[2].  Fix it by extending damon_call_control for the use case and
updating the usage on DAMON sysfs interface to use per-context
dynamically allocated damon_call_control object.

[1] https://lore.kernel.org/20250904011738.930-1-yunjeong.mun@sk.com
[2] https://lore.kernel.org/20250905035411.39501-1-sj@kernel.org

SeongJae Park (2):
  mm/damon/core: introduce damon_call_control->dealloc_on_cancel
  mm/damon/sysfs: use dynamically allocated repeat mode
    damon_call_control

 include/linux/damon.h |  2 ++
 mm/damon/core.c       |  8 ++++++--
 mm/damon/sysfs.c      | 23 +++++++++++++++--------
 3 files changed, 23 insertions(+), 10 deletions(-)


base-commit: c6680f5947fa5ff95bc881f2c4e36443478c8829
-- 
2.39.5


             reply	other threads:[~2025-09-08 20:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-08 20:15 SeongJae Park [this message]
2025-09-08 20:15 ` [PATCH 1/2] mm/damon/core: introduce damon_call_control->dealloc_on_cancel SeongJae Park
2025-09-08 20:15 ` [PATCH 2/2] mm/damon/sysfs: use dynamically allocated repeat mode damon_call_control SeongJae Park

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=20250908201513.60802-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=yunjeong.mun@sk.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