mirror of
https://github.com/torvalds/linux.git
synced 2025-04-12 06:49:52 +00:00
mm/damon/paddr: support ops_filters
DAMON keeps all DAMOS filters in damos->filters. Upcoming changes will make it to use damos->ops_filters for all operations layer handled DAMOS filters, though. DAMON physical address space operations set implementation (paddr) is not ready for the changes, since it handles only damos->filters. To avoid any breakage during the upcoming changes, make paddr to handle both lists. After the change is made, ->filters support on paddr can be safely removed. Link: https://lkml.kernel.org/r/20250304211913.53574-3-sj@kernel.org Signed-off-by: SeongJae Park <sj@kernel.org> Cc: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
parent
ab82e57981
commit
ac7b094bf4
@ -260,6 +260,10 @@ static bool damos_pa_filter_out(struct damos *scheme, struct folio *folio)
|
||||
if (damos_pa_filter_match(filter, folio))
|
||||
return !filter->allow;
|
||||
}
|
||||
damos_for_each_ops_filter(filter, scheme) {
|
||||
if (damos_pa_filter_match(filter, folio))
|
||||
return !filter->allow;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -290,6 +294,12 @@ static unsigned long damon_pa_pageout(struct damon_region *r, struct damos *s,
|
||||
break;
|
||||
}
|
||||
}
|
||||
damos_for_each_ops_filter(filter, s) {
|
||||
if (filter->type == DAMOS_FILTER_TYPE_YOUNG) {
|
||||
install_young_filter = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (install_young_filter) {
|
||||
filter = damos_new_filter(
|
||||
DAMOS_FILTER_TYPE_YOUNG, true, false);
|
||||
@ -538,6 +548,8 @@ static bool damon_pa_scheme_has_filter(struct damos *s)
|
||||
|
||||
damos_for_each_filter(f, s)
|
||||
return true;
|
||||
damos_for_each_ops_filter(f, s)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user