]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mm/damon: add default allow/reject behavior fields to struct damos
authorSeongJae Park <sj@kernel.org>
Tue, 4 Mar 2025 21:19:10 +0000 (13:19 -0800)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 17 Mar 2025 07:05:39 +0000 (00:05 -0700)
Current default allow/reject behavior of filters handling stage has made
before introduction of the allow behavior.  For allow-filters usage, it is
confusing and inefficient.

It is more intuitive to decide the default filtering stage allow/reject
behavior as opposite to the last filter's behavior.  The decision should
be made separately for core and operations layers' filtering stages, since
last core layer-handled filter is not really a last filter if there are
operations layer handling filters.

Keeping separate decisions for the two categories can make the logic
simpler.  Add fields for storing the two decisions.

Link: https://lkml.kernel.org/r/20250304211913.53574-7-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>
include/linux/damon.h

index 7f76e2e99f376e3289cd287b457d38325dab8250..52559475dbe763266e1a6d33a76a1b93b679193d 100644 (file)
@@ -502,6 +502,9 @@ struct damos {
         * layer-handled filters.  If true, operations layer allows it, too.
         */
        bool core_filters_allowed;
+       /* whether to reject core/ops filters umatched regions */
+       bool core_filters_default_reject;
+       bool ops_filters_default_reject;
 /* public: */
        struct damos_quota quota;
        struct damos_watermarks wmarks;