]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
drop queue-6.0/mm-damon-sysfs-fix-wrong-empty-schemes-assumption-under-online-tuning...
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Dec 2022 11:35:59 +0000 (12:35 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Dec 2022 11:35:59 +0000 (12:35 +0100)
queue-6.0/mm-damon-sysfs-fix-wrong-empty-schemes-assumption-under-online-tuning-in-damon_sysfs_set_schemes.patch [deleted file]
queue-6.0/series

diff --git a/queue-6.0/mm-damon-sysfs-fix-wrong-empty-schemes-assumption-under-online-tuning-in-damon_sysfs_set_schemes.patch b/queue-6.0/mm-damon-sysfs-fix-wrong-empty-schemes-assumption-under-online-tuning-in-damon_sysfs_set_schemes.patch
deleted file mode 100644 (file)
index 9cdfb9a..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-From 95bc35f9bee5220dad4e8567654ab3288a181639 Mon Sep 17 00:00:00 2001
-From: SeongJae Park <sj@kernel.org>
-Date: Tue, 22 Nov 2022 19:48:31 +0000
-Subject: mm/damon/sysfs: fix wrong empty schemes assumption under online tuning in damon_sysfs_set_schemes()
-
-From: SeongJae Park <sj@kernel.org>
-
-commit 95bc35f9bee5220dad4e8567654ab3288a181639 upstream.
-
-Commit da87878010e5 ("mm/damon/sysfs: support online inputs update") made
-'damon_sysfs_set_schemes()' to be called for running DAMON context, which
-could have schemes.  In the case, DAMON sysfs interface is supposed to
-update, remove, or add schemes to reflect the sysfs files.  However, the
-code is assuming the DAMON context wouldn't have schemes at all, and
-therefore creates and adds new schemes.  As a result, the code doesn't
-work as intended for online schemes tuning and could have more than
-expected memory footprint.  The schemes are all in the DAMON context, so
-it doesn't leak the memory, though.
-
-Remove the wrong asssumption (the DAMON context wouldn't have schemes) in
-'damon_sysfs_set_schemes()' to fix the bug.
-
-Link: https://lkml.kernel.org/r/20221122194831.3472-1-sj@kernel.org
-Fixes: da87878010e5 ("mm/damon/sysfs: support online inputs update")
-Signed-off-by: SeongJae Park <sj@kernel.org>
-Cc: <stable@vger.kernel.org>   [5.19+]
-Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- mm/damon/sysfs.c |   46 ++++++++++++++++++++++++++++++++++++++++++++--
- 1 file changed, 44 insertions(+), 2 deletions(-)
-
---- a/mm/damon/sysfs.c
-+++ b/mm/damon/sysfs.c
-@@ -2286,12 +2286,54 @@ static struct damos *damon_sysfs_mk_sche
-                       sysfs_scheme->action, &quota, &wmarks);
- }
-+static void damon_sysfs_update_scheme(struct damos *scheme,
-+              struct damon_sysfs_scheme *sysfs_scheme)
-+{
-+      struct damon_sysfs_access_pattern *access_pattern =
-+              sysfs_scheme->access_pattern;
-+      struct damon_sysfs_quotas *sysfs_quotas = sysfs_scheme->quotas;
-+      struct damon_sysfs_weights *sysfs_weights = sysfs_quotas->weights;
-+      struct damon_sysfs_watermarks *sysfs_wmarks = sysfs_scheme->watermarks;
-+
-+      scheme->pattern.min_sz_region = access_pattern->sz->min;
-+      scheme->pattern.max_sz_region = access_pattern->sz->max;
-+      scheme->pattern.min_nr_accesses = access_pattern->nr_accesses->min;
-+      scheme->pattern.max_nr_accesses = access_pattern->nr_accesses->max;
-+      scheme->pattern.min_age_region = access_pattern->age->min;
-+      scheme->pattern.max_age_region = access_pattern->age->max;
-+
-+      scheme->action = sysfs_scheme->action;
-+
-+      scheme->quota.ms = sysfs_quotas->ms;
-+      scheme->quota.sz = sysfs_quotas->sz;
-+      scheme->quota.reset_interval = sysfs_quotas->reset_interval_ms;
-+      scheme->quota.weight_sz = sysfs_weights->sz;
-+      scheme->quota.weight_nr_accesses = sysfs_weights->nr_accesses;
-+      scheme->quota.weight_age = sysfs_weights->age;
-+
-+      scheme->wmarks.metric = sysfs_wmarks->metric;
-+      scheme->wmarks.interval = sysfs_wmarks->interval_us;
-+      scheme->wmarks.high = sysfs_wmarks->high;
-+      scheme->wmarks.mid = sysfs_wmarks->mid;
-+      scheme->wmarks.low = sysfs_wmarks->low;
-+}
-+
- static int damon_sysfs_set_schemes(struct damon_ctx *ctx,
-               struct damon_sysfs_schemes *sysfs_schemes)
- {
--      int i;
-+      struct damos *scheme, *next;
-+      int i = 0;
-+
-+      damon_for_each_scheme_safe(scheme, next, ctx) {
-+              if (i < sysfs_schemes->nr)
-+                      damon_sysfs_update_scheme(scheme,
-+                                      sysfs_schemes->schemes_arr[i]);
-+              else
-+                      damon_destroy_scheme(scheme);
-+              i++;
-+      }
--      for (i = 0; i < sysfs_schemes->nr; i++) {
-+      for (; i < sysfs_schemes->nr; i++) {
-               struct damos *scheme, *next;
-               scheme = damon_sysfs_mk_scheme(sysfs_schemes->schemes_arr[i]);
index c34002ab85c0db7be9cfdc5390a9661a8283c127..81ce2ca1c9826852dd6fe9a78f8183705da2f057 100644 (file)
@@ -99,4 +99,3 @@ drm-i915-never-return-0-if-not-all-requests-retired.patch
 tracing-osnoise-fix-duration-type.patch
 tracing-fix-race-where-histograms-can-be-called-before-the-event.patch
 tracing-free-buffers-when-a-used-dynamic-event-is-removed.patch
-mm-damon-sysfs-fix-wrong-empty-schemes-assumption-under-online-tuning-in-damon_sysfs_set_schemes.patch