From: SeongJae Park <sj@kernel.org>
To: SeongJae Park <sj@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
damon@lists.linux.dev, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 1/2] mm/damon/sysfs: remove requested targets when online-commit inputs
Date: Sat, 28 Oct 2023 21:09:30 +0000 [thread overview]
Message-ID: <20231028210930.62947-1-sj@kernel.org> (raw)
In-Reply-To: <20231022210735.46409-2-sj@kernel.org>
On Sun, 22 Oct 2023 21:07:33 +0000 SeongJae Park <sj@kernel.org> wrote:
> damon_sysfs_set_targets(), which updates the targets of the context for
> online commitment, do not remove targets that removed from the
> corresponding sysfs files. As a result, more than intended targets of
> the context can exist and hence consume memory and monitoring CPU
> resource more than expected.
>
> Fix it by removing all targets of the context and fill up again using
> the user input. This could cause unnecessary memory dealloc and realloc
> operations, but this is not a hot code path. Also, note that
> damon_target is stateless, and hence no data is lost.
This is not true. 'struct damon_target' contains monitoring results
(regions_list). Hence, this patch makes all monitoring results to be removed
whenever doing online-commit. I was confused with init_regions at the time of
this writing, sorry.
I will send a fix for this soon.
Thanks,
SJ
next prev parent reply other threads:[~2023-10-28 21:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-22 21:07 [PATCH 0/2] mm/damon/sysfs: fix unexpected targets adding bug SeongJae Park
2023-10-22 21:07 ` [PATCH 1/2] mm/damon/sysfs: remove requested targets when online-commit inputs SeongJae Park
2023-10-28 21:09 ` SeongJae Park [this message]
2023-10-22 21:07 ` [PATCH 2/2] mm/damon/sysfs-test: add a unit test for damon_sysfs_set_targets() 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=20231028210930.62947-1-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=damon@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=stable@vger.kernel.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 read-only IMAP folder(s) and NNTP newsgroup(s).