linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] replace per-quota region priorities histogram buffer with per-context one
@ 2024-08-26  4:23 SeongJae Park
  2024-08-26  4:23 ` [PATCH 1/4] mm/damon/core: intorduce per-context region priorities histogram buffer SeongJae Park
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: SeongJae Park @ 2024-08-26  4:23 UTC (permalink / raw)
  To: Andrew Morton; +Cc: SeongJae Park, damon, linux-mm, linux-kernel

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-08-26  4:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-26  4:23 [PATCH 0/4] replace per-quota region priorities histogram buffer with per-context one SeongJae Park
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

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).