linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] mm/damon/schemes: Extend stats for better online analysis and tuning
@ 2021-12-10 15:00 SeongJae Park
  2021-12-10 15:00 ` [PATCH 1/6] mm/damon/schemes: Account scheme actions that successfully applied SeongJae Park
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: SeongJae Park @ 2021-12-10 15:00 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, SeongJae Park

To help online access pattern analysis and tuning of DAMON-based
Operation Schemes (DAMOS), DAMOS provides simple statistics for each
scheme.  Introduction of DAMOS time/space quota further made the tuning
easier by making the risk management easier.  However, that also made
understanding of the working schemes a little bit more difficult.

For an example, progress of a given scheme can now be throttled by not
only the aggressiveness of the target access pattern, but also the
time/space quotas.  So, when a scheme is showing unexpectedly slow
progress, it's difficult to know by what the progress of the scheme is
throttled, with currently provided statistics.

This patchset extends the statistics to contain some metrics that can be
helpful for such online schemes analysis and tuning (patches 1-2),
exports those to users (patches 3 and 5), and add documents (patches 4
and 6).

SeongJae Park (6):
  mm/damon/schemes: Account scheme actions that successfully applied
  mm/damon/schemes: Account how many times quota limit has exceeded
  mm/damon/reclaim: Provide reclamation statistics
  Docs/admin-guide/mm/damon/reclaim: Document statistics parameters
  mm/damon/dbgfs: Support all DAMOS stats
  Docs/admin-guide/mm/damon/usage: Update for schemes statistics

 .../admin-guide/mm/damon/reclaim.rst          | 25 ++++++++++
 Documentation/admin-guide/mm/damon/usage.rst  |  9 ++--
 include/linux/damon.h                         | 30 +++++++++---
 mm/damon/core.c                               | 15 ++++--
 mm/damon/dbgfs.c                              |  6 ++-
 mm/damon/paddr.c                              | 13 +++---
 mm/damon/reclaim.c                            | 46 +++++++++++++++++++
 mm/damon/vaddr.c                              | 30 ++++++------
 8 files changed, 136 insertions(+), 38 deletions(-)

-- 
2.17.1



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

* [PATCH 1/6] mm/damon/schemes: Account scheme actions that successfully applied
  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 ` SeongJae Park
  2021-12-10 15:00 ` [PATCH 2/6] mm/damon/schemes: Account how many times quota limit has exceeded SeongJae Park
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: SeongJae Park @ 2021-12-10 15:00 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, SeongJae Park

DAMON-based operation schemes (DAMOS) stats provide only the number and
the amount of regions that the action of the scheme has tried to be
applied.  Because the action could be failed for some reasons, the
currently provided information is sometimes not useful or convenient
enough for schemes profiling and tuning.  To improve this situation,
this commit extends the DAMOS stats to provide the number and the amount
of regions that the action has successfully applied.

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 include/linux/damon.h | 28 +++++++++++++++++++++-------
 mm/damon/core.c       | 13 ++++++++-----
 mm/damon/dbgfs.c      |  2 +-
 mm/damon/paddr.c      | 13 +++++++------
 mm/damon/vaddr.c      | 30 ++++++++++++++++--------------
 5 files changed, 53 insertions(+), 33 deletions(-)

diff --git a/include/linux/damon.h b/include/linux/damon.h
index 97f4a224e950..e0ad3d9aaeed 100644
--- a/include/linux/damon.h
+++ b/include/linux/damon.h
@@ -192,6 +192,20 @@ struct damos_watermarks {
 	bool activated;
 };
 
+/**
+ * struct damos_stat - Statistics on a given scheme.
+ * @nr_tried:	Total number of regions that the scheme is tried to be applied.
+ * @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.
+ */
+struct damos_stat {
+	unsigned long nr_tried;
+	unsigned long sz_tried;
+	unsigned long nr_applied;
+	unsigned long sz_applied;
+};
+
 /**
  * struct damos - Represents a Data Access Monitoring-based Operation Scheme.
  * @min_sz_region:	Minimum size of target regions.
@@ -203,8 +217,7 @@ struct damos_watermarks {
  * @action:		&damo_action to be applied to the target regions.
  * @quota:		Control the aggressiveness of this scheme.
  * @wmarks:		Watermarks for automated (in)activation of this scheme.
- * @stat_count:		Total number of regions that this scheme is applied.
- * @stat_sz:		Total size of regions that this scheme is applied.
+ * @stat:		Statistics of this scheme.
  * @list:		List head for siblings.
  *
  * For each aggregation interval, DAMON finds regions which fit in the
@@ -235,8 +248,7 @@ struct damos {
 	enum damos_action action;
 	struct damos_quota quota;
 	struct damos_watermarks wmarks;
-	unsigned long stat_count;
-	unsigned long stat_sz;
+	struct damos_stat stat;
 	struct list_head list;
 };
 
@@ -281,7 +293,8 @@ struct damon_ctx;
  * as an integer in [0, &DAMOS_MAX_SCORE].
  * @apply_scheme is called from @kdamond when a region for user provided
  * DAMON-based operation scheme is found.  It should apply the scheme's action
- * to the region.
+ * to the region and return bytes of the region that the action is successfully
+ * applied.
  * @target_valid should check whether the target is still valid for the
  * monitoring.
  * @cleanup is called from @kdamond just before its termination.
@@ -295,8 +308,9 @@ struct damon_primitive {
 	int (*get_scheme_score)(struct damon_ctx *context,
 			struct damon_target *t, struct damon_region *r,
 			struct damos *scheme);
-	int (*apply_scheme)(struct damon_ctx *context, struct damon_target *t,
-			struct damon_region *r, struct damos *scheme);
+	unsigned long (*apply_scheme)(struct damon_ctx *context,
+			struct damon_target *t, struct damon_region *r,
+			struct damos *scheme);
 	bool (*target_valid)(void *target);
 	void (*cleanup)(struct damon_ctx *context);
 };
diff --git a/mm/damon/core.c b/mm/damon/core.c
index 70771cf7da89..6d59047b8923 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -112,8 +112,7 @@ struct damos *damon_new_scheme(
 	scheme->min_age_region = min_age_region;
 	scheme->max_age_region = max_age_region;
 	scheme->action = action;
-	scheme->stat_count = 0;
-	scheme->stat_sz = 0;
+	scheme->stat = (struct damos_stat){};
 	INIT_LIST_HEAD(&scheme->list);
 
 	scheme->quota.ms = quota->ms;
@@ -603,6 +602,7 @@ static void damon_do_apply_schemes(struct damon_ctx *c,
 		struct damos_quota *quota = &s->quota;
 		unsigned long sz = r->ar.end - r->ar.start;
 		struct timespec64 begin, end;
+		unsigned long sz_applied = 0;
 
 		if (!s->wmarks.activated)
 			continue;
@@ -665,7 +665,7 @@ static void damon_do_apply_schemes(struct damon_ctx *c,
 				damon_split_region_at(c, t, r, sz);
 			}
 			ktime_get_coarse_ts64(&begin);
-			c->primitive.apply_scheme(c, t, r, s);
+			sz_applied = c->primitive.apply_scheme(c, t, r, s);
 			ktime_get_coarse_ts64(&end);
 			quota->total_charged_ns += timespec64_to_ns(&end) -
 				timespec64_to_ns(&begin);
@@ -679,8 +679,11 @@ static void damon_do_apply_schemes(struct damon_ctx *c,
 			r->age = 0;
 
 update_stat:
-		s->stat_count++;
-		s->stat_sz += sz;
+		s->stat.nr_tried++;
+		s->stat.sz_tried += sz;
+		if (sz_applied)
+			s->stat.nr_applied++;
+		s->stat.sz_applied += sz_applied;
 	}
 }
 
diff --git a/mm/damon/dbgfs.c b/mm/damon/dbgfs.c
index 5b628990ae6e..ef79b7b7716d 100644
--- a/mm/damon/dbgfs.c
+++ b/mm/damon/dbgfs.c
@@ -117,7 +117,7 @@ static ssize_t sprint_schemes(struct damon_ctx *c, char *buf, ssize_t len)
 				s->quota.weight_age,
 				s->wmarks.metric, s->wmarks.interval,
 				s->wmarks.high, s->wmarks.mid, s->wmarks.low,
-				s->stat_count, s->stat_sz);
+				s->stat.nr_tried, s->stat.sz_tried);
 		if (!rc)
 			return -ENOMEM;
 
diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c
index 4318134cbc4c..5e8244f65a1a 100644
--- a/mm/damon/paddr.c
+++ b/mm/damon/paddr.c
@@ -213,14 +213,15 @@ bool damon_pa_target_valid(void *t)
 	return true;
 }
 
-static int damon_pa_apply_scheme(struct damon_ctx *ctx, struct damon_target *t,
-		struct damon_region *r, struct damos *scheme)
+static unsigned long damon_pa_apply_scheme(struct damon_ctx *ctx,
+		struct damon_target *t, struct damon_region *r,
+		struct damos *scheme)
 {
-	unsigned long addr;
+	unsigned long addr, applied;
 	LIST_HEAD(page_list);
 
 	if (scheme->action != DAMOS_PAGEOUT)
-		return -EINVAL;
+		return 0;
 
 	for (addr = r->ar.start; addr < r->ar.end; addr += PAGE_SIZE) {
 		struct page *page = damon_get_page(PHYS_PFN(addr));
@@ -241,9 +242,9 @@ static int damon_pa_apply_scheme(struct damon_ctx *ctx, struct damon_target *t,
 			put_page(page);
 		}
 	}
-	reclaim_pages(&page_list);
+	applied = reclaim_pages(&page_list);
 	cond_resched();
-	return 0;
+	return applied * PAGE_SIZE;
 }
 
 static int damon_pa_scheme_score(struct damon_ctx *context,
diff --git a/mm/damon/vaddr.c b/mm/damon/vaddr.c
index 68d9e4134816..a10df3fd3d02 100644
--- a/mm/damon/vaddr.c
+++ b/mm/damon/vaddr.c
@@ -572,32 +572,34 @@ bool damon_va_target_valid(void *target)
 }
 
 #ifndef CONFIG_ADVISE_SYSCALLS
-static int damos_madvise(struct damon_target *target, struct damon_region *r,
-			int behavior)
+static unsigned long damos_madvise(struct damon_target *target,
+		struct damon_region *r, int behavior)
 {
-	return -EINVAL;
+	return 0;
 }
 #else
-static int damos_madvise(struct damon_target *target, struct damon_region *r,
-			int behavior)
+static unsigned long damos_madvise(struct damon_target *target,
+		struct damon_region *r, int behavior)
 {
 	struct mm_struct *mm;
-	int ret = -ENOMEM;
+	unsigned long start = PAGE_ALIGN(r->ar.start);
+	unsigned long len = PAGE_ALIGN(r->ar.end - r->ar.start);
+	unsigned long applied;
 
 	mm = damon_get_mm(target);
 	if (!mm)
-		goto out;
+		return 0;
 
-	ret = do_madvise(mm, PAGE_ALIGN(r->ar.start),
-			PAGE_ALIGN(r->ar.end - r->ar.start), behavior);
+	applied = do_madvise(mm, start, len, behavior) ? 0 : len;
 	mmput(mm);
-out:
-	return ret;
+
+	return applied;
 }
 #endif	/* CONFIG_ADVISE_SYSCALLS */
 
-static int damon_va_apply_scheme(struct damon_ctx *ctx, struct damon_target *t,
-		struct damon_region *r, struct damos *scheme)
+static unsigned long damon_va_apply_scheme(struct damon_ctx *ctx,
+		struct damon_target *t, struct damon_region *r,
+		struct damos *scheme)
 {
 	int madv_action;
 
@@ -620,7 +622,7 @@ static int damon_va_apply_scheme(struct damon_ctx *ctx, struct damon_target *t,
 	case DAMOS_STAT:
 		return 0;
 	default:
-		return -EINVAL;
+		return 0;
 	}
 
 	return damos_madvise(t, r, madv_action);
-- 
2.17.1



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

* [PATCH 2/6] mm/damon/schemes: Account how many times quota limit has exceeded
  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
  2021-12-10 15:00 ` [PATCH 3/6] mm/damon/reclaim: Provide reclamation statistics SeongJae Park
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: SeongJae Park @ 2021-12-10 15:00 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, SeongJae Park

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



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

* [PATCH 3/6] mm/damon/reclaim: Provide reclamation statistics
  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 ` [PATCH 2/6] mm/damon/schemes: Account how many times quota limit has exceeded SeongJae Park
@ 2021-12-10 15:00 ` SeongJae Park
  2021-12-10 15:00 ` [PATCH 4/6] Docs/admin-guide/mm/damon/reclaim: Document statistics parameters SeongJae Park
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: SeongJae Park @ 2021-12-10 15:00 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, SeongJae Park

This commit implements new DAMON_RECLAIM parameters for statistics
reporting.  Those can be used for understanding how DAMON_RECLAIM is
working, and for tuning the other parameters.

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 mm/damon/reclaim.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/mm/damon/reclaim.c b/mm/damon/reclaim.c
index dc1485044eaf..bc476cef688e 100644
--- a/mm/damon/reclaim.c
+++ b/mm/damon/reclaim.c
@@ -185,6 +185,36 @@ module_param(monitor_region_end, ulong, 0600);
 static int kdamond_pid __read_mostly = -1;
 module_param(kdamond_pid, int, 0400);
 
+/*
+ * Number of memory regions that tried to be reclaimed.
+ */
+static unsigned long nr_reclaim_tried_regions __read_mostly;
+module_param(nr_reclaim_tried_regions, ulong, 0400);
+
+/*
+ * Total bytes of memory regions that tried to be reclaimed.
+ */
+static unsigned long bytes_reclaim_tried_regions __read_mostly;
+module_param(bytes_reclaim_tried_regions, ulong, 0400);
+
+/*
+ * Number of memory regions that successfully be reclaimed.
+ */
+static unsigned long nr_reclaimed_regions __read_mostly;
+module_param(nr_reclaimed_regions, ulong, 0400);
+
+/*
+ * Total bytes of memory regions that successfully be reclaimed.
+ */
+static unsigned long bytes_reclaimed_regions __read_mostly;
+module_param(bytes_reclaimed_regions, ulong, 0400);
+
+/*
+ * Number of times that the time/space quota limits have exceeded
+ */
+static unsigned long nr_quota_exceeds __read_mostly;
+module_param(nr_quota_exceeds, ulong, 0400);
+
 static struct damon_ctx *ctx;
 static struct damon_target *target;
 
@@ -333,6 +363,21 @@ static void damon_reclaim_timer_fn(struct work_struct *work)
 }
 static DECLARE_DELAYED_WORK(damon_reclaim_timer, damon_reclaim_timer_fn);
 
+static int damon_reclaim_after_aggregation(struct damon_ctx *c)
+{
+	struct damos *s;
+
+	/* update the stats parameter */
+	damon_for_each_scheme(s, c) {
+		nr_reclaim_tried_regions = s->stat.nr_tried;
+		bytes_reclaim_tried_regions = s->stat.sz_tried;
+		nr_reclaimed_regions = s->stat.nr_applied;
+		bytes_reclaimed_regions = s->stat.sz_applied;
+		nr_quota_exceeds = s->stat.qt_exceeds;
+	}
+	return 0;
+}
+
 static int __init damon_reclaim_init(void)
 {
 	ctx = damon_new_ctx();
@@ -340,6 +385,7 @@ static int __init damon_reclaim_init(void)
 		return -ENOMEM;
 
 	damon_pa_set_primitives(ctx);
+	ctx->callback.after_aggregation = damon_reclaim_after_aggregation;
 
 	/* 4242 means nothing but fun */
 	target = damon_new_target(4242);
-- 
2.17.1



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

* [PATCH 4/6] Docs/admin-guide/mm/damon/reclaim: Document statistics parameters
  2021-12-10 15:00 [PATCH 0/6] mm/damon/schemes: Extend stats for better online analysis and tuning SeongJae Park
                   ` (2 preceding siblings ...)
  2021-12-10 15:00 ` [PATCH 3/6] mm/damon/reclaim: Provide reclamation statistics SeongJae Park
@ 2021-12-10 15:00 ` 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
  5 siblings, 0 replies; 7+ messages in thread
From: SeongJae Park @ 2021-12-10 15:00 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, SeongJae Park

This commit adds descriptions for the DAMON_RECLAIM statistics
parameters.

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 .../admin-guide/mm/damon/reclaim.rst          | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/Documentation/admin-guide/mm/damon/reclaim.rst b/Documentation/admin-guide/mm/damon/reclaim.rst
index fb9def3a7355..0af51a9705b1 100644
--- a/Documentation/admin-guide/mm/damon/reclaim.rst
+++ b/Documentation/admin-guide/mm/damon/reclaim.rst
@@ -208,6 +208,31 @@ PID of the DAMON thread.
 If DAMON_RECLAIM is enabled, this becomes the PID of the worker thread.  Else,
 -1.
 
+nr_reclaim_tried_regions
+------------------------
+
+Number of memory regions that tried to be reclaimed by DAMON_RECLAIM.
+
+bytes_reclaim_tried_regions
+---------------------------
+
+Total bytes of memory regions that tried to be reclaimed by DAMON_RECLAIM.
+
+nr_reclaimed_regions
+--------------------
+
+Number of memory regions that successfully be reclaimed by DAMON_RECLAIM.
+
+bytes_reclaimed_regions
+-----------------------
+
+Total bytes of memory regions that successfully be reclaimed by DAMON_RECLAIM.
+
+nr_quota_exceeds
+----------------
+
+Number of times that the time/space quota limits have exceeded.
+
 Example
 =======
 
-- 
2.17.1



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

* [PATCH 5/6] mm/damon/dbgfs: Support all DAMOS stats
  2021-12-10 15:00 [PATCH 0/6] mm/damon/schemes: Extend stats for better online analysis and tuning SeongJae Park
                   ` (3 preceding siblings ...)
  2021-12-10 15:00 ` [PATCH 4/6] Docs/admin-guide/mm/damon/reclaim: Document statistics parameters SeongJae Park
@ 2021-12-10 15:00 ` SeongJae Park
  2021-12-10 15:00 ` [PATCH 6/6] Docs/admin-guide/mm/damon/usage: Update for schemes statistics SeongJae Park
  5 siblings, 0 replies; 7+ messages in thread
From: SeongJae Park @ 2021-12-10 15:00 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, SeongJae Park

Currently, DAMON debugfs interface is not supporting DAMON-based
Operation Schemes (DAMOS) stats for schemes successfully applied regions
and time/space quota limit exceeds.  This commit adds the support.

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 mm/damon/dbgfs.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mm/damon/dbgfs.c b/mm/damon/dbgfs.c
index ef79b7b7716d..58dbb9692279 100644
--- a/mm/damon/dbgfs.c
+++ b/mm/damon/dbgfs.c
@@ -105,7 +105,7 @@ static ssize_t sprint_schemes(struct damon_ctx *c, char *buf, ssize_t len)
 
 	damon_for_each_scheme(s, c) {
 		rc = scnprintf(&buf[written], len - written,
-				"%lu %lu %u %u %u %u %d %lu %lu %lu %u %u %u %d %lu %lu %lu %lu %lu %lu\n",
+				"%lu %lu %u %u %u %u %d %lu %lu %lu %u %u %u %d %lu %lu %lu %lu %lu %lu %lu %lu %lu\n",
 				s->min_sz_region, s->max_sz_region,
 				s->min_nr_accesses, s->max_nr_accesses,
 				s->min_age_region, s->max_age_region,
@@ -117,7 +117,9 @@ static ssize_t sprint_schemes(struct damon_ctx *c, char *buf, ssize_t len)
 				s->quota.weight_age,
 				s->wmarks.metric, s->wmarks.interval,
 				s->wmarks.high, s->wmarks.mid, s->wmarks.low,
-				s->stat.nr_tried, s->stat.sz_tried);
+				s->stat.nr_tried, s->stat.sz_tried,
+				s->stat.nr_applied, s->stat.sz_applied,
+				s->stat.qt_exceeds);
 		if (!rc)
 			return -ENOMEM;
 
-- 
2.17.1



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

* [PATCH 6/6] Docs/admin-guide/mm/damon/usage: Update for schemes statistics
  2021-12-10 15:00 [PATCH 0/6] mm/damon/schemes: Extend stats for better online analysis and tuning SeongJae Park
                   ` (4 preceding siblings ...)
  2021-12-10 15:00 ` [PATCH 5/6] mm/damon/dbgfs: Support all DAMOS stats SeongJae Park
@ 2021-12-10 15:00 ` SeongJae Park
  5 siblings, 0 replies; 7+ messages in thread
From: SeongJae Park @ 2021-12-10 15:00 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, SeongJae Park

This commit updates DAMON debugfs interface for statistics of schemes
successfully applied regions and time/space quota limit exceeds counts.

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 Documentation/admin-guide/mm/damon/usage.rst | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/Documentation/admin-guide/mm/damon/usage.rst b/Documentation/admin-guide/mm/damon/usage.rst
index cb614c84ba9e..59b84904a854 100644
--- a/Documentation/admin-guide/mm/damon/usage.rst
+++ b/Documentation/admin-guide/mm/damon/usage.rst
@@ -223,12 +223,13 @@ is activated.
 Statistics
 ~~~~~~~~~~
 
-It also counts the total number and bytes of regions that each scheme is
-applied.  This statistics can be used for online analysis or tuning of the
-schemes.
+It also counts the total number and bytes of regions that each scheme is tried
+to be applied, the two numbers for the regions that each scheme is successfully
+applied, and the total number of the quota limit exceeds.  This statistics can
+be used for online analysis or tuning of the schemes.
 
 The statistics can be shown by reading the ``schemes`` file.  Reading the file
-will show each scheme you entered in each line, and the two numbers for the
+will show each scheme you entered in each line, and the five numbers for the
 statistics will be added at the end of each line.
 
 Example
-- 
2.17.1



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

end of thread, other threads:[~2021-12-10 15:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH 2/6] mm/damon/schemes: Account how many times quota limit has exceeded SeongJae Park
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox