The patch titled Subject: mm/damon/core: add number of each enum type values has been added to the -mm tree. Its filename is mm-damon-core-add-number-of-each-enum-type-values.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/mm-damon-core-add-number-of-each-enum-type-values.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/mm-damon-core-add-number-of-each-enum-type-values.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/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/20220228081314.5770-3-sj@xxxxxxxxxx Signed-off-by: SeongJae Park <sj@xxxxxxxxxx> Cc: David Rientjes <rientjes@xxxxxxxxxx> Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> Cc: Jonathan Corbet <corbet@xxxxxxx> Cc: Shuah Khan <skhan@xxxxxxxxxxxxxxxxxxx> Cc: Xin Hao <xhao@xxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/damon.h | 4 ++++ 1 file changed, 4 insertions(+) --- a/include/linux/damon.h~mm-damon-core-add-number-of-each-enum-type-values +++ a/include/linux/damon.h @@ -87,6 +87,7 @@ struct damon_target { * @DAMOS_HUGEPAGE: Call ``madvise()`` for the region with MADV_HUGEPAGE. * @DAMOS_NOHUGEPAGE: Call ``madvise()`` for the region with MADV_NOHUGEPAGE. * @DAMOS_STAT: Do nothing but count the stat. + * @NR_DAMOS_ACTIONS: Total number of DAMOS actions */ enum damos_action { DAMOS_WILLNEED, @@ -95,6 +96,7 @@ enum damos_action { DAMOS_HUGEPAGE, DAMOS_NOHUGEPAGE, DAMOS_STAT, /* Do nothing but only record the stat */ + NR_DAMOS_ACTIONS, }; /** @@ -157,10 +159,12 @@ struct damos_quota { * * @DAMOS_WMARK_NONE: Ignore the watermarks of the given scheme. * @DAMOS_WMARK_FREE_MEM_RATE: Free memory rate of the system in [0,1000]. + * @NR_DAMOS_WMARK_METRICS: Total number of DAMOS watermark metrics */ enum damos_wmark_metric { DAMOS_WMARK_NONE, DAMOS_WMARK_FREE_MEM_RATE, + NR_DAMOS_WMARK_METRICS, }; /** _ Patches currently in -mm which might be from sj@xxxxxxxxxx are mm-damon-dbgfs-init_regions-use-target-index-instead-of-target-id.patch docs-admin-guide-mm-damon-usage-update-for-changed-initail_regions-file-input.patch mm-damon-core-move-damon_set_targets-into-dbgfs.patch mm-damon-remove-the-target-id-concept.patch mm-damon-rename-damon_primitives-to-damon_operations.patch mm-damon-let-monitoring-operations-can-be-registered-and-selected.patch mm-damon-paddrvaddr-register-themselves-to-damon-in-subsys_initcall.patch mm-damon-reclaim-use-damon_select_ops-instead-of-damon_vpa_set_operations.patch mm-damon-dbgfs-use-damon_select_ops-instead-of-damon_vpa_set_operations.patch mm-damon-dbgfs-use-operations-id-for-knowing-if-the-target-has-pid.patch mm-damon-dbgfs-test-fix-is_target_id-change.patch mm-damon-paddrvaddr-remove-damon_pva_target_validset_operations.patch docs-vm-damon-call-low-level-monitoring-primitives-the-operations.patch docs-vm-damon-design-update-damon-idle-page-tracking-interference-handling.patch docs-damon-update-outdated-term-regions-update-interval.patch mm-damon-core-allow-non-exclusive-damon-start-stop.patch mm-damon-core-add-number-of-each-enum-type-values.patch mm-damon-implement-a-minimal-stub-for-sysfs-based-damon-interface.patch mm-damon-sysfs-link-damon-for-virtual-address-spaces-monitoring.patch mm-damon-sysfs-support-the-physical-address-space-monitoring.patch mm-damon-sysfs-support-damon-based-operation-schemes.patch mm-damon-sysfs-support-damos-quotas.patch mm-damon-sysfs-support-schemes-prioritization.patch mm-damon-sysfs-support-damos-watermarks.patch mm-damon-sysfs-support-damos-stats.patch selftests-damon-add-a-test-for-damon-sysfs-interface.patch docs-admin-guide-mm-damon-usage-document-damon-sysfs-interface.patch docs-abi-testing-add-damon-sysfs-interface-abi-document.patch