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>,
	damon@lists.linux.dev, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 0/4] replace per-quota region priorities histogram buffer with per-context one
Date: Sun, 25 Aug 2024 21:23:19 -0700	[thread overview]
Message-ID: <20240826042323.87025-1-sj@kernel.org> (raw)

Each DAMOS quota (struct damos_quota) maintains a histogram for total
regions size per its prioritization score.  DAMOS calcultes minimum
prioritization score of regions that are ok to apply the DAMOS action to
while respecting the quota.  The histogram is constructed only for the
calculation of the minimum score in damos_adjust_quota() for each quota
which called by kdamond_fn().

Hence, there is no real reason to have per-quota histogram.  Only
per-kdamond histogram is needed, since parallel kdamonds could have
races otherwise.  The current implementation is only wasting the memory,
and can easily cause unintended stack usage[1].

So, introducing a per-kdamond histogram and replacing the per-quota one
with it would be the right solution for the issue.  However, supporting
multiple DAMON contexts per kdamond is still an ongoing work[2] without
a clear estimated time of arrival.  Meanwhile, per-context histogram
could be an effective and straightforward solution having no blocker.
Let's fix the problem first in the way.

SeongJae Park (4):
  mm/damon/core: intorduce per-context region priorities histogram
    buffer
  mm/damon/core: replace per-quota regions priority histogram buffer
    usage with per-context one
  mm/damon/core: remove per-scheme region priority histogram buffer
  Revert "mm/damon/lru_sort: adjust local variable to dynamic
    allocation"

 include/linux/damon.h |  3 ++-
 mm/damon/core.c       | 14 +++++++++++---
 mm/damon/lru_sort.c   | 15 ++++-----------
 3 files changed, 17 insertions(+), 15 deletions(-)


base-commit: 9b7ae00cf6b2d882ac7062d1cf0f752933c8e461
-- 
2.39.2



             reply	other threads:[~2024-08-26  4:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-26  4:23 SeongJae Park [this message]
2024-08-26  4:23 ` [PATCH 1/4] mm/damon/core: intorduce per-context region priorities histogram buffer SeongJae Park
2024-08-26  4:23 ` [PATCH 2/4] mm/damon/core: replace per-quota regions priority histogram buffer usage with per-context one SeongJae Park
2024-08-26  4:23 ` [PATCH 3/4] mm/damon/core: remove per-scheme region priority histogram buffer SeongJae Park
2024-08-26  4:23 ` [PATCH 4/4] Revert "mm/damon/lru_sort: adjust local variable to dynamic allocation" 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=20240826042323.87025-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 \
    /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 NNTP newsgroup(s).