Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/damon: rename damos->filters to damos->core_filters

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>

authored by

SeongJae Park and committed by
Andrew Morton
53298afe 8b02baf3

+15 -15
+5 -5
include/linux/damon.h
··· 492 492 * @wmarks: Watermarks for automated (in)activation of this scheme. 493 493 * @migrate_dests: Destination nodes if @action is "migrate_{hot,cold}". 494 494 * @target_nid: Destination node if @action is "migrate_{hot,cold}". 495 - * @filters: Additional set of &struct damos_filter for &action. 495 + * @core_filters: Additional set of &struct damos_filter for &action. 496 496 * @ops_filters: ops layer handling &struct damos_filter objects list. 497 497 * @last_applied: Last @action applied ops-managing entity. 498 498 * @stat: Statistics of this scheme. ··· 518 518 * 519 519 * Before applying the &action to a memory region, &struct damon_operations 520 520 * implementation could check pages of the region and skip &action to respect 521 - * &filters 521 + * &core_filters 522 522 * 523 523 * The minimum entity that @action can be applied depends on the underlying 524 524 * &struct damon_operations. Since it may not be aligned with the core layer ··· 562 562 struct damos_migrate_dests migrate_dests; 563 563 }; 564 564 }; 565 - struct list_head filters; 565 + struct list_head core_filters; 566 566 struct list_head ops_filters; 567 567 void *last_applied; 568 568 struct damos_stat stat; ··· 872 872 list_for_each_entry_safe(goal, next, &(quota)->goals, list) 873 873 874 874 #define damos_for_each_core_filter(f, scheme) \ 875 - list_for_each_entry(f, &(scheme)->filters, list) 875 + list_for_each_entry(f, &(scheme)->core_filters, list) 876 876 877 877 #define damos_for_each_core_filter_safe(f, next, scheme) \ 878 - list_for_each_entry_safe(f, next, &(scheme)->filters, list) 878 + list_for_each_entry_safe(f, next, &(scheme)->core_filters, list) 879 879 880 880 #define damos_for_each_ops_filter(f, scheme) \ 881 881 list_for_each_entry(f, &(scheme)->ops_filters, list)
+3 -3
mm/damon/core.c
··· 306 306 if (damos_filter_for_ops(f->type)) 307 307 list_add_tail(&f->list, &s->ops_filters); 308 308 else 309 - list_add_tail(&f->list, &s->filters); 309 + list_add_tail(&f->list, &s->core_filters); 310 310 } 311 311 312 312 static void damos_del_filter(struct damos_filter *f) ··· 397 397 */ 398 398 scheme->next_apply_sis = 0; 399 399 scheme->walk_completed = false; 400 - INIT_LIST_HEAD(&scheme->filters); 400 + INIT_LIST_HEAD(&scheme->core_filters); 401 401 INIT_LIST_HEAD(&scheme->ops_filters); 402 402 scheme->stat = (struct damos_stat){}; 403 403 INIT_LIST_HEAD(&scheme->list); ··· 995 995 s->core_filters_default_reject = false; 996 996 else 997 997 s->core_filters_default_reject = 998 - damos_filters_default_reject(&s->filters); 998 + damos_filters_default_reject(&s->core_filters); 999 999 s->ops_filters_default_reject = 1000 1000 damos_filters_default_reject(&s->ops_filters); 1001 1001 }
+2 -2
mm/damon/tests/core-kunit.h
··· 876 876 static void damos_test_help_initailize_scheme(struct damos *scheme) 877 877 { 878 878 INIT_LIST_HEAD(&scheme->quota.goals); 879 - INIT_LIST_HEAD(&scheme->filters); 879 + INIT_LIST_HEAD(&scheme->core_filters); 880 880 INIT_LIST_HEAD(&scheme->ops_filters); 881 881 } 882 882 ··· 1140 1140 struct damos scheme; 1141 1141 struct damos_filter *target_filter, *anon_filter; 1142 1142 1143 - INIT_LIST_HEAD(&scheme.filters); 1143 + INIT_LIST_HEAD(&scheme.core_filters); 1144 1144 INIT_LIST_HEAD(&scheme.ops_filters); 1145 1145 1146 1146 damos_set_filters_default_reject(&scheme);
+4 -4
tools/testing/selftests/damon/drgn_dump_damon_status.py
··· 175 175 ['target_nid', int], 176 176 ['migrate_dests', damos_migrate_dests_to_dict], 177 177 ]) 178 - filters = [] 178 + core_filters = [] 179 179 for f in list_for_each_entry( 180 - 'struct damos_filter', scheme.filters.address_of_(), 'list'): 181 - filters.append(damos_filter_to_dict(f)) 182 - dict_['filters'] = filters 180 + 'struct damos_filter', scheme.core_filters.address_of_(), 'list'): 181 + core_filters.append(damos_filter_to_dict(f)) 182 + dict_['core_filters'] = core_filters 183 183 ops_filters = [] 184 184 for f in list_for_each_entry( 185 185 'struct damos_filter', scheme.ops_filters.address_of_(), 'list'):
+1 -1
tools/testing/selftests/damon/sysfs.py
··· 132 132 assert_watermarks_committed(scheme.watermarks, dump['wmarks']) 133 133 # TODO: test filters directory 134 134 for idx, f in enumerate(scheme.core_filters.filters): 135 - assert_filter_committed(f, dump['filters'][idx]) 135 + assert_filter_committed(f, dump['core_filters'][idx]) 136 136 for idx, f in enumerate(scheme.ops_filters.filters): 137 137 assert_filter_committed(f, dump['ops_filters'][idx]) 138 138