All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged mm-stable] mm-damon-simplify-scheme-create-in-damon_lru_sort_apply_parameters.patch removed from -mm tree
@ 2022-10-03 21:07 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2022-10-03 21:07 UTC (permalink / raw)
  To: mm-commits, sj, xhao, akpm


The quilt patch titled
     Subject: mm/damon: simplify scheme create in damon_lru_sort_apply_parameters
has been removed from the -mm tree.  Its filename was
     mm-damon-simplify-scheme-create-in-damon_lru_sort_apply_parameters.patch

This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Xin Hao <xhao@linux.alibaba.com>
Subject: mm/damon: simplify scheme create in damon_lru_sort_apply_parameters
Date: Sun, 11 Sep 2022 08:59:17 +0800

In damon_lru_sort_apply_parameters(), we can use damon_set_schemes() to
replace the way of creating the first 'scheme' in original code, this
makes the code look cleaner.

Link: https://lkml.kernel.org/r/20220911005917.835-1-xhao@linux.alibaba.com
Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/damon/lru_sort.c |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

--- a/mm/damon/lru_sort.c~mm-damon-simplify-scheme-create-in-damon_lru_sort_apply_parameters
+++ a/mm/damon/lru_sort.c
@@ -350,7 +350,7 @@ static struct damos *damon_lru_sort_new_
 
 static int damon_lru_sort_apply_parameters(void)
 {
-	struct damos *scheme, *next_scheme;
+	struct damos *scheme;
 	struct damon_addr_range addr_range;
 	unsigned int hot_thres, cold_thres;
 	int err = 0;
@@ -360,17 +360,15 @@ static int damon_lru_sort_apply_paramete
 	if (err)
 		return err;
 
-	/* free previously set schemes */
-	damon_for_each_scheme_safe(scheme, next_scheme, ctx)
-		damon_destroy_scheme(scheme);
-
 	/* aggr_interval / sample_interval is the maximum nr_accesses */
 	hot_thres = aggr_interval / sample_interval * hot_thres_access_freq /
 		1000;
 	scheme = damon_lru_sort_new_hot_scheme(hot_thres);
 	if (!scheme)
 		return -ENOMEM;
-	damon_add_scheme(ctx, scheme);
+	err = damon_set_schemes(ctx, &scheme, 1);
+	if (err)
+		return err;
 
 	cold_thres = cold_min_age / aggr_interval;
 	scheme = damon_lru_sort_new_cold_scheme(cold_thres);
_

Patches currently in -mm which might be from xhao@linux.alibaba.com are

mm-damon-move-sz_damon_region-to-damon_sz_region.patch
mm-damon-use-damon_sz_region-in-appropriate-place.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-10-03 21:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-03 21:07 [merged mm-stable] mm-damon-simplify-scheme-create-in-damon_lru_sort_apply_parameters.patch removed from -mm tree Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.