The patch titled Subject: mm/damon/schemes: account how many times quota limit has exceeded has been added to the -mm tree. Its filename is mm-damon-schemes-account-how-many-times-quota-limit-has-exceeded.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/mm-damon-schemes-account-how-many-times-quota-limit-has-exceeded.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/mm-damon-schemes-account-how-many-times-quota-limit-has-exceeded.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: SeongJae Park <sj@xxxxxxxxxx> Subject: mm/damon/schemes: account how many times quota limit has exceeded If the time/space quotas of a given DAMON-based operation scheme is too small, the scheme could show unexpectedly slow progress. However, there is no good way to notice the case in runtime. This commit extends the DAMOS stat to provide how many times the quota limits exceeded so that the users can easily notice the case and tune the scheme. Link: https://lkml.kernel.org/r/20211210150016.35349-3-sj@xxxxxxxxxx Signed-off-by: SeongJae Park <sj@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/damon.h | 2 ++ mm/damon/core.c | 2 ++ 2 files changed, 4 insertions(+) --- a/include/linux/damon.h~mm-damon-schemes-account-how-many-times-quota-limit-has-exceeded +++ a/include/linux/damon.h @@ -198,12 +198,14 @@ struct damos_watermarks { * @sz_tried: Total size of regions that the scheme is tried to be applied. * @nr_applied: Total number of regions that the scheme is applied. * @sz_applied: Total size of regions that the scheme is applied. + * @qt_exceeds: Total number of times the quota of the scheme has exceeded. */ struct damos_stat { unsigned long nr_tried; unsigned long sz_tried; unsigned long nr_applied; unsigned long sz_applied; + unsigned long qt_exceeds; }; /** --- a/mm/damon/core.c~mm-damon-schemes-account-how-many-times-quota-limit-has-exceeded +++ a/mm/damon/core.c @@ -693,6 +693,8 @@ static void kdamond_apply_schemes(struct if (time_after_eq(jiffies, quota->charged_from + msecs_to_jiffies( quota->reset_interval))) { + if (quota->esz && quota->charged_sz >= quota->esz) + s->stat.qt_exceeds++; quota->total_charged_sz += quota->charged_sz; quota->charged_from = jiffies; quota->charged_sz = 0; _ Patches currently in -mm which might be from sj@xxxxxxxxxx are timers-implement-usleep_idle_range.patch mm-damon-core-fix-fake-load-reports-due-to-uninterruptible-sleeps.patch mm-damon-core-use-better-timer-mechanisms-selection-threshold.patch mm-damon-dbgfs-remove-an-unnecessary-error-message.patch mm-damon-core-remove-unnecessary-error-messages.patch mm-damon-vaddr-remove-an-unnecessary-warning-message.patch mm-damon-vaddr-test-split-a-test-function-having-1024-bytes-frame-size.patch mm-damon-vaddr-test-remove-unnecessary-variables.patch selftests-damon-skip-test-if-damon-is-running.patch selftests-damon-test-damon-enabling-with-empty-target_ids-case.patch selftests-damon-test-wrong-damos-condition-ranges-input.patch selftests-damon-test-debugfs-file-reads-writes-with-huge-count.patch selftests-damon-split-test-cases.patch mm-damon-remove-some-no-need-func-definitions-in-damonh-file-fix.patch mm-damon-convert-macro-functions-to-static-inline-functions.patch docs-admin-guide-mm-damon-usage-update-for-scheme-quotas-and-watermarks.patch docs-admin-guide-mm-damon-usage-remove-redundant-information.patch docs-admin-guide-mm-damon-usage-mention-tracepoint-at-the-beginning.patch docs-admin-guide-mm-damon-usage-update-for-kdamond_pid-and-mkrm_contexts.patch mm-damon-remove-a-mistakenly-added-comment-for-a-future-feature.patch mm-damon-schemes-account-scheme-actions-that-successfully-applied.patch mm-damon-schemes-account-how-many-times-quota-limit-has-exceeded.patch mm-damon-reclaim-provide-reclamation-statistics.patch docs-admin-guide-mm-damon-reclaim-document-statistics-parameters.patch mm-damon-dbgfs-support-all-damos-stats.patch docs-admin-guide-mm-damon-usage-update-for-schemes-statistics.patch