Skip to content

Commit 6268eac

Browse files
sjp38torvalds
authored andcommitted
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/[email protected] Signed-off-by: SeongJae Park <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 0e92c2e commit 6268eac

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

include/linux/damon.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,14 @@ struct damos_watermarks {
198198
* @sz_tried: Total size of regions that the scheme is tried to be applied.
199199
* @nr_applied: Total number of regions that the scheme is applied.
200200
* @sz_applied: Total size of regions that the scheme is applied.
201+
* @qt_exceeds: Total number of times the quota of the scheme has exceeded.
201202
*/
202203
struct damos_stat {
203204
unsigned long nr_tried;
204205
unsigned long sz_tried;
205206
unsigned long nr_applied;
206207
unsigned long sz_applied;
208+
unsigned long qt_exceeds;
207209
};
208210

209211
/**

mm/damon/core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,8 @@ static void kdamond_apply_schemes(struct damon_ctx *c)
693693
if (time_after_eq(jiffies, quota->charged_from +
694694
msecs_to_jiffies(
695695
quota->reset_interval))) {
696+
if (quota->esz && quota->charged_sz >= quota->esz)
697+
s->stat.qt_exceeds++;
696698
quota->total_charged_sz += quota->charged_sz;
697699
quota->charged_from = jiffies;
698700
quota->charged_sz = 0;

0 commit comments

Comments
 (0)