[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240826042323.87025-1-sj@kernel.org>
Date: Sun, 25 Aug 2024 21:23:19 -0700
From: SeongJae Park <sj@...nel.org>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: SeongJae Park <sj@...nel.org>,
damon@...ts.linux.dev,
linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 0/4] replace per-quota region priorities histogram buffer with per-context one
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
Powered by blists - more mailing lists