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