public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: Akinobu Mita <akinobu.mita@gmail.com>
Cc: SeongJae Park <sj@kernel.org>,
	damon@lists.linux.dev, linux-mm@kvack.org,
	akpm@linux-foundation.org
Subject: Re: [PATCH] mm/damon/core: avoid destroyed target reference from DAMOS quota
Date: Sat, 17 May 2025 08:56:33 -0700	[thread overview]
Message-ID: <20250517155633.35139-1-sj@kernel.org> (raw)
In-Reply-To: <20250517141852.142802-1-akinobu.mita@gmail.com>

On Sat, 17 May 2025 23:18:52 +0900 Akinobu Mita <akinobu.mita@gmail.com> wrote:

> When the number of the monitoring targets in running contexts is reduced,
> there may be DAMOS quotas referencing the targets that will be destroyed.
> 
> Applying the scheme action for such DAMOS scheme will be skipped forever
> looking for the starting part of the region for the destroyed monitoring
> target.

Nice catch!

> 
> To fix this issue, when the monitoring target is destroyed, reset the
> starting part for all DAMOS quotas that reference the target.
> 

I think this deserves below Fixes: tag?

Fixes: da87878010e5 ("mm/damon/sysfs: support online inputs update")

For a clarification.  The worst scenario consequence of this issue is DAMOS
unexpectedly doing less or zero works under certain setups.  No horrible
problems such as a use after free will happen, though, since quota handling
code references quota.charge_target_from, but does not de-reference it.

So I don't think this deserves Cc-ing stable@, but I'll let stable@ maintainers
decide, as usual.

> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: SeongJae Park <sj@kernel.org>

Reviewed-by: SeongJae Park <sj@kernel.org>


Thanks,
SJ

[...]


      reply	other threads:[~2025-05-17 15:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-17 14:18 [PATCH] mm/damon/core: avoid destroyed target reference from DAMOS quota Akinobu Mita
2025-05-17 15:56 ` 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=20250517155633.35139-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akinobu.mita@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --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