]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mm/damon: rename damos->filters to damos->core_filters
authorSeongJae Park <sj@kernel.org>
Wed, 12 Nov 2025 15:41:05 +0000 (07:41 -0800)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 20 Nov 2025 21:44:01 +0000 (13:44 -0800)
DAMOS filters that are handled by the ops layer are linked to
damos->ops_filters.  Owing to the ops_ prefix on the name, it is easy to
understand it is for ops layer handled filters.  The other types of
filters, which are handled by the core layer, are linked to
damos->filters.  Because of the name, it is easy to confuse the list is
there for not only core layer handled ones but all filters.  Avoid such
confusions by renaming the field to core_filters.

Link: https://lkml.kernel.org/r/20251112154114.66053-3-sj@kernel.org
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: Bill Wendling <morbo@google.com>
Cc: Brendan Higgins <brendan.higgins@linux.dev>
Cc: David Gow <davidgow@google.com>
Cc: David Hildenbrand <david@kernel.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Justin Stitt <justinstitt@google.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Miguel Ojeda <ojeda@kernel.org>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
include/linux/damon.h
mm/damon/core.c
mm/damon/tests/core-kunit.h
tools/testing/selftests/damon/drgn_dump_damon_status.py
tools/testing/selftests/damon/sysfs.py

index 6e3db165fe606ee8642dbd12d3a9d102405dd82e..3813373a9200c44d300154419d2b11dd92a9094e 100644 (file)
@@ -492,7 +492,7 @@ struct damos_migrate_dests {
  * @wmarks:            Watermarks for automated (in)activation of this scheme.
  * @migrate_dests:     Destination nodes if @action is "migrate_{hot,cold}".
  * @target_nid:                Destination node if @action is "migrate_{hot,cold}".
- * @filters:           Additional set of &struct damos_filter for &action.
+ * @core_filters:      Additional set of &struct damos_filter for &action.
  * @ops_filters:       ops layer handling &struct damos_filter objects list.
  * @last_applied:      Last @action applied ops-managing entity.
  * @stat:              Statistics of this scheme.
@@ -518,7 +518,7 @@ struct damos_migrate_dests {
  *
  * Before applying the &action to a memory region, &struct damon_operations
  * implementation could check pages of the region and skip &action to respect
- * &filters
+ * &core_filters
  *
  * The minimum entity that @action can be applied depends on the underlying
  * &struct damon_operations.  Since it may not be aligned with the core layer
@@ -562,7 +562,7 @@ struct damos {
                        struct damos_migrate_dests migrate_dests;
                };
        };
-       struct list_head filters;
+       struct list_head core_filters;
        struct list_head ops_filters;
        void *last_applied;
        struct damos_stat stat;
@@ -872,10 +872,10 @@ static inline unsigned long damon_sz_region(struct damon_region *r)
        list_for_each_entry_safe(goal, next, &(quota)->goals, list)
 
 #define damos_for_each_core_filter(f, scheme) \
-       list_for_each_entry(f, &(scheme)->filters, list)
+       list_for_each_entry(f, &(scheme)->core_filters, list)
 
 #define damos_for_each_core_filter_safe(f, next, scheme) \
-       list_for_each_entry_safe(f, next, &(scheme)->filters, list)
+       list_for_each_entry_safe(f, next, &(scheme)->core_filters, list)
 
 #define damos_for_each_ops_filter(f, scheme) \
        list_for_each_entry(f, &(scheme)->ops_filters, list)
index d4cb11ced13f682dabdc5f0e2c00da915a07acf9..aedb315b075a65eb119cd0e891531f8547c28786 100644 (file)
@@ -306,7 +306,7 @@ void damos_add_filter(struct damos *s, struct damos_filter *f)
        if (damos_filter_for_ops(f->type))
                list_add_tail(&f->list, &s->ops_filters);
        else
-               list_add_tail(&f->list, &s->filters);
+               list_add_tail(&f->list, &s->core_filters);
 }
 
 static void damos_del_filter(struct damos_filter *f)
@@ -397,7 +397,7 @@ struct damos *damon_new_scheme(struct damos_access_pattern *pattern,
         */
        scheme->next_apply_sis = 0;
        scheme->walk_completed = false;
-       INIT_LIST_HEAD(&scheme->filters);
+       INIT_LIST_HEAD(&scheme->core_filters);
        INIT_LIST_HEAD(&scheme->ops_filters);
        scheme->stat = (struct damos_stat){};
        INIT_LIST_HEAD(&scheme->list);
@@ -995,7 +995,7 @@ static void damos_set_filters_default_reject(struct damos *s)
                s->core_filters_default_reject = false;
        else
                s->core_filters_default_reject =
-                       damos_filters_default_reject(&s->filters);
+                       damos_filters_default_reject(&s->core_filters);
        s->ops_filters_default_reject =
                damos_filters_default_reject(&s->ops_filters);
 }
index 0d2d8cda863130a4a599071584158b71a4e03480..4380d0312d2491d8d5e75d16b328dfc38fb08ca6 100644 (file)
@@ -876,7 +876,7 @@ static void damos_test_commit_filter(struct kunit *test)
 static void damos_test_help_initailize_scheme(struct damos *scheme)
 {
        INIT_LIST_HEAD(&scheme->quota.goals);
-       INIT_LIST_HEAD(&scheme->filters);
+       INIT_LIST_HEAD(&scheme->core_filters);
        INIT_LIST_HEAD(&scheme->ops_filters);
 }
 
@@ -1140,7 +1140,7 @@ static void damon_test_set_filters_default_reject(struct kunit *test)
        struct damos scheme;
        struct damos_filter *target_filter, *anon_filter;
 
-       INIT_LIST_HEAD(&scheme.filters);
+       INIT_LIST_HEAD(&scheme.core_filters);
        INIT_LIST_HEAD(&scheme.ops_filters);
 
        damos_set_filters_default_reject(&scheme);
index cb4fdbe68acb8d477f125f8336764104532b4974..5374d18d1fa8dd65e4af41287e3b67642d317f6b 100755 (executable)
@@ -175,11 +175,11 @@ def scheme_to_dict(scheme):
         ['target_nid', int],
         ['migrate_dests', damos_migrate_dests_to_dict],
         ])
-    filters = []
+    core_filters = []
     for f in list_for_each_entry(
-            'struct damos_filter', scheme.filters.address_of_(), 'list'):
-        filters.append(damos_filter_to_dict(f))
-    dict_['filters'] = filters
+            'struct damos_filter', scheme.core_filters.address_of_(), 'list'):
+        core_filters.append(damos_filter_to_dict(f))
+    dict_['core_filters'] = core_filters
     ops_filters = []
     for f in list_for_each_entry(
             'struct damos_filter', scheme.ops_filters.address_of_(), 'list'):
index b34aea0a677513404537d08daf4958a40f42184b..b4c5ef5c4d69d6dae1f5d0408e289d4b69cc02da 100755 (executable)
@@ -132,7 +132,7 @@ def assert_scheme_committed(scheme, dump):
     assert_watermarks_committed(scheme.watermarks, dump['wmarks'])
     # TODO: test filters directory
     for idx, f in enumerate(scheme.core_filters.filters):
-        assert_filter_committed(f, dump['filters'][idx])
+        assert_filter_committed(f, dump['core_filters'][idx])
     for idx, f in enumerate(scheme.ops_filters.filters):
         assert_filter_committed(f, dump['ops_filters'][idx])