Skip to content

Commit 5257f36

Browse files
sjp38torvalds
authored andcommitted
mm/damon/core: add number of each enum type values
This commit declares the number of legal values for each DAMON enum types to make traversals of such DAMON enum types easy and safe. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: SeongJae Park <[email protected]> Cc: David Rientjes <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Xin Hao <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 8b9b0d3 commit 5257f36

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/linux/damon.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ struct damon_target {
8787
* @DAMOS_HUGEPAGE: Call ``madvise()`` for the region with MADV_HUGEPAGE.
8888
* @DAMOS_NOHUGEPAGE: Call ``madvise()`` for the region with MADV_NOHUGEPAGE.
8989
* @DAMOS_STAT: Do nothing but count the stat.
90+
* @NR_DAMOS_ACTIONS: Total number of DAMOS actions
9091
*/
9192
enum damos_action {
9293
DAMOS_WILLNEED,
@@ -95,6 +96,7 @@ enum damos_action {
9596
DAMOS_HUGEPAGE,
9697
DAMOS_NOHUGEPAGE,
9798
DAMOS_STAT, /* Do nothing but only record the stat */
99+
NR_DAMOS_ACTIONS,
98100
};
99101

100102
/**
@@ -157,10 +159,12 @@ struct damos_quota {
157159
*
158160
* @DAMOS_WMARK_NONE: Ignore the watermarks of the given scheme.
159161
* @DAMOS_WMARK_FREE_MEM_RATE: Free memory rate of the system in [0,1000].
162+
* @NR_DAMOS_WMARK_METRICS: Total number of DAMOS watermark metrics
160163
*/
161164
enum damos_wmark_metric {
162165
DAMOS_WMARK_NONE,
163166
DAMOS_WMARK_FREE_MEM_RATE,
167+
NR_DAMOS_WMARK_METRICS,
164168
};
165169

166170
/**

0 commit comments

Comments
 (0)