From: SeongJae Park <sj@kernel.org>
To: akpm@linux-foundation.org
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
SeongJae Park <sj@kernel.org>
Subject: [PATCH 2/6] mm/damon/schemes: Account how many times quota limit has exceeded
Date: Fri, 10 Dec 2021 15:00:12 +0000 [thread overview]
Message-ID: <20211210150016.35349-3-sj@kernel.org> (raw)
In-Reply-To: <20211210150016.35349-1-sj@kernel.org>
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.
Signed-off-by: SeongJae Park <sj@kernel.org>
---
include/linux/damon.h | 2 ++
mm/damon/core.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/include/linux/damon.h b/include/linux/damon.h
index e0ad3d9aaeed..af648388e759 100644
--- a/include/linux/damon.h
+++ b/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;
};
/**
diff --git a/mm/damon/core.c b/mm/damon/core.c
index 6d59047b8923..30d4b6e1a434 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -731,6 +731,8 @@ static void kdamond_apply_schemes(struct damon_ctx *c)
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;
--
2.17.1
next prev parent reply other threads:[~2021-12-10 15:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-10 15:00 [PATCH 0/6] mm/damon/schemes: Extend stats for better online analysis and tuning SeongJae Park
2021-12-10 15:00 ` [PATCH 1/6] mm/damon/schemes: Account scheme actions that successfully applied SeongJae Park
2021-12-10 15:00 ` SeongJae Park [this message]
2021-12-10 15:00 ` [PATCH 3/6] mm/damon/reclaim: Provide reclamation statistics SeongJae Park
2021-12-10 15:00 ` [PATCH 4/6] Docs/admin-guide/mm/damon/reclaim: Document statistics parameters SeongJae Park
2021-12-10 15:00 ` [PATCH 5/6] mm/damon/dbgfs: Support all DAMOS stats SeongJae Park
2021-12-10 15:00 ` [PATCH 6/6] Docs/admin-guide/mm/damon/usage: Update for schemes statistics 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=20211210150016.35349-3-sj@kernel.org \
--to=sj@kernel.org \
--cc=akpm@linux-foundation.org \
--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