Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH mm-hotfixes-unstable 0/3] mm/damon: three fixes for idle_time overflow and damos_walk() hang
@ 2026-11-23 15:00 SJ Park
  2026-11-23 15:00 ` [PATCH mm-hotfixes-unstable 1/3] mm/damon/stat: avoid 32-bit overflow in idle time milliseconds SJ Park
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: SJ Park @ 2026-11-23 15:00 UTC (permalink / raw)
  To: Andrew Morton; +Cc: SJ Park, stable, Aveline Noir, damon, linux-mm

Avoid 32-bit overflow of idle time calculation in DAMON_STAT, via
patch 1 from David Carlier.  Fix a damos_walk() hang that can happen
under certain watermarks setup and a watermarks commit internal state
overwrite issue, via patches 2 and 3 from Yifan Feng.

This is a batched reposting of separately posted and reviewed patches
for being merged into the mm.git.  Refer to changelog on each patch for
changes that were made before this reposting.

David Carlier (1):
  mm/damon/stat: avoid 32-bit overflow in idle time milliseconds

Yifan Feng (2):
  mm/damon/core: fix damos_walk() hang with zero watermarks interval
  mm/damon/core: do not overwrite wmarks.activated in damos_commit()

 mm/damon/core.c | 13 ++++++++++++-
 mm/damon/stat.c |  4 ++--
 2 files changed, 14 insertions(+), 3 deletions(-)


base-commit: f6538c11c47408c69dc77d38fea1b2a4fca86f3e
-- 
2.47.3

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH mm-hotfixes-unstable 1/3] mm/damon/stat: avoid 32-bit overflow in idle time milliseconds
  2026-11-23 15:00 [PATCH mm-hotfixes-unstable 0/3] mm/damon: three fixes for idle_time overflow and damos_walk() hang SJ Park
@ 2026-11-23 15:00 ` SJ Park
  2026-11-23 17:48   ` + mm-damon-stat-avoid-32-bit-overflow-in-idle-time-milliseconds.patch added to mm-hotfixes-unstable branch Andrew Morton
  2026-11-23 15:00 ` [PATCH mm-hotfixes-unstable 2/3] mm/damon/core: fix damos_walk() hang with zero watermarks interval SJ Park
  2026-11-23 15:00 ` [PATCH mm-hotfixes-unstable 3/3] mm/damon/core: do not overwrite wmarks.activated in damos_commit() SJ Park
  2 siblings, 1 reply; 7+ messages in thread
From: SJ Park @ 2026-11-23 15:00 UTC (permalink / raw)
  To: Andrew Morton
  Cc: David Carlier, Aveline Noir, SJ Park, damon, linux-mm, stable

From: David Carlier <devnexen@gmail.com>

On 32-bit, the region idle time in microseconds is computed in a long
before the division to milliseconds. It wraps once a region has been
idle for about 36 minutes regardless of the intervals, so the cold end
of memory_idle_ms_percentiles reports wrong values with flipped signs.

Do the multiplication in 64 bits and divide with div_s64() so the sign
of recently accessed regions is kept.

Fixes: e5d2585d9e85 ("mm/damon/stat: calculate and expose idle time percentiles")
Cc: stable@vger.kernel.org
Cc: Aveline Noir <jm5905938@gmail.com>
Signed-off-by: David Carlier <devnexen@gmail.com>
Reviewed-by: SJ Park <sj@kernel.org>
Signed-off-by: SJ Park <sj@kernel.org>
---
Changes from v1
- v1: https://lore.kernel.org/20261117094339.30978-1-devnexen@gmail.com
- Collect R-b: from SJ.
- Rebase to the latest mm-new.

 mm/damon/stat.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/damon/stat.c b/mm/damon/stat.c
index e44f5bf3645cc..d90a43becaddf 100644
--- a/mm/damon/stat.c
+++ b/mm/damon/stat.c
@@ -129,8 +129,8 @@ static void damon_stat_set_idletime_percentiles(struct damon_ctx *c)
 		accounted_bytes += region->ar.end - region->ar.start;
 		while (next_percentile <= accounted_bytes * 100 / total_sz)
 			memory_idle_ms_percentiles[next_percentile++] =
-				damon_stat_idletime(region) *
-				(long)c->attrs.aggr_interval / USEC_PER_MSEC;
+				div_s64((s64)damon_stat_idletime(region) *
+				c->attrs.aggr_interval, USEC_PER_MSEC);
 	}
 	kfree(sorted_regions);
 }
-- 
2.47.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH mm-hotfixes-unstable 2/3] mm/damon/core: fix damos_walk() hang with zero watermarks interval
  2026-11-23 15:00 [PATCH mm-hotfixes-unstable 0/3] mm/damon: three fixes for idle_time overflow and damos_walk() hang SJ Park
  2026-11-23 15:00 ` [PATCH mm-hotfixes-unstable 1/3] mm/damon/stat: avoid 32-bit overflow in idle time milliseconds SJ Park
@ 2026-11-23 15:00 ` SJ Park
  2026-11-23 17:48   ` + mm-damon-core-fix-damos_walk-hang-with-zero-watermarks-interval.patch added to mm-hotfixes-unstable branch Andrew Morton
  2026-11-23 15:00 ` [PATCH mm-hotfixes-unstable 3/3] mm/damon/core: do not overwrite wmarks.activated in damos_commit() SJ Park
  2 siblings, 1 reply; 7+ messages in thread
From: SJ Park @ 2026-11-23 15:00 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Yifan Feng, stable, SJ Park, damon, linux-mm

From: Yifan Feng <evanfengff@gmail.com>

kdamond_wait_activation() cancels damos_walk() requests while all
schemes are deactivated by their watermarks.  But it returns without
waiting when the watermarks check interval of a deactivated scheme is
zero, which is the default of the DAMON sysfs interface.  The kdamond
main loop then runs with all schemes deactivated.

In that state, kdamond_apply_schemes() finds no scheme to apply and
returns before it calls damos_walk_complete().  The walk request is
neither completed nor cancelled, so damos_walk() waits until the
watermarks activate a scheme again, possibly forever.

For example, with a scheme that has the free_mem_rate metric, zero
interval_us and a high watermark below the current free memory rate,
writing update_schemes_tried_regions to the kdamond state file never
returns and cannot be killed.  The writer holds damon_sysfs_lock, so all
other DAMON sysfs writes including "off" fail with -EBUSY meanwhile.

Cancel the walk request in kdamond_apply_schemes() when no scheme is
activated, as kdamond_wait_activation() does for a non-zero interval.

Link: https://lore.kernel.org/20261121025626.75981-1-evanfengff@gmail.com
Fixes: bf0eaba0ff9c ("mm/damon/core: implement damos_walk()")
Cc: <stable@vger.kernel.org> # 6.14.x
Suggested-by: SJ Park <sj@kernel.org>
Signed-off-by: Yifan Feng <evanfengff@gmail.com>
Reviewed-by: SJ Park <sj@kernel.org>
Signed-off-by: SJ Park <sj@kernel.org>
---
Changes from v2
- v2: https://lore.kernel.org/20261121025626.75981-1-evanfengff@gmail.com
- Collect R-b: from SJ.
- Rebase to the latest mm-new.
Changes from v1
- v1: https://lore.kernel.org/r/20261118235012.14859-1-evanfengff@gmail.com
- Cancel the walk when no scheme is activated, and leave
  has_schemes_to_apply as it is (SJ Park).

 mm/damon/core.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/mm/damon/core.c b/mm/damon/core.c
index b8678a53b0a98..2748f91999240 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -3492,9 +3492,13 @@ static noinline_for_stack void kdamond_apply_schemes(struct damon_ctx *c)
 	struct damon_target *t;
 	struct damos *s;
 	bool has_schemes_to_apply = false;
+	bool has_activated_schemes = false;
 	unsigned long max_region_sz;
 
 	damon_for_each_scheme(s, c) {
+		if (s->wmarks.activated)
+			has_activated_schemes = true;
+
 		if (time_before(c->passed_sample_intervals, s->next_apply_sis))
 			continue;
 
@@ -3506,8 +3510,12 @@ static noinline_for_stack void kdamond_apply_schemes(struct damon_ctx *c)
 		damos_adjust_quota(c, s);
 	}
 
-	if (!has_schemes_to_apply)
+	if (!has_schemes_to_apply) {
+		/* The walk cannot be completed while no scheme is activated */
+		if (!has_activated_schemes)
+			damos_walk_cancel(c);
 		return;
+	}
 
 	max_region_sz = damon_region_sz_limit(c);
 	mutex_lock(&c->walk_control_lock);
-- 
2.47.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH mm-hotfixes-unstable 3/3] mm/damon/core: do not overwrite wmarks.activated in damos_commit()
  2026-11-23 15:00 [PATCH mm-hotfixes-unstable 0/3] mm/damon: three fixes for idle_time overflow and damos_walk() hang SJ Park
  2026-11-23 15:00 ` [PATCH mm-hotfixes-unstable 1/3] mm/damon/stat: avoid 32-bit overflow in idle time milliseconds SJ Park
  2026-11-23 15:00 ` [PATCH mm-hotfixes-unstable 2/3] mm/damon/core: fix damos_walk() hang with zero watermarks interval SJ Park
@ 2026-11-23 15:00 ` SJ Park
  2026-11-23 17:48   ` + mm-damon-core-do-not-overwrite-wmarksactivated-in-damos_commit.patch added to mm-hotfixes-unstable branch Andrew Morton
  2 siblings, 1 reply; 7+ messages in thread
From: SJ Park @ 2026-11-23 15:00 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Yifan Feng, stable, SJ Park, damon, linux-mm

From: Yifan Feng <evanfengff@gmail.com>

damos_commit() copies the whole wmarks struct from the source scheme,
including the private 'activated' field.  The source scheme is a new
one, so the field is always true there.

As a result, a commit turns on a scheme that the watermarks turned off.
If the metric is between mid and high at that time, the scheme keeps
running, though it should stay off until the metric goes below mid.
DAMON_RECLAIM and DAMON_LRU_SORT use the same path for commit_inputs.

Save 'activated' before the copy and restore it after.  Do not restore
it for DAMOS_WMARK_NONE, because nothing sets it again in that case and
the scheme would stay off.

Fixes: 9cb3d0b9dfce ("mm/damon/core: implement DAMON context commit function")
Cc: <stable@vger.kernel.org> # 6.11.x
Signed-off-by: Yifan Feng <evanfengff@gmail.com>
Reviewed-by: SJ Park <sj@kernel.org>
Signed-off-by: SJ Park <sj@kernel.org>
---
Changes from v1
- v1: https://lore.kernel.org/20261122002930.98401-1-evanfengff@gmail.com
- Collect R-b: from SJ.

 mm/damon/core.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mm/damon/core.c b/mm/damon/core.c
index 2748f91999240..0e6b361f97ea6 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -1567,6 +1567,7 @@ static struct damos *damon_nth_scheme(int n, struct damon_ctx *ctx)
 
 static int damos_commit(struct damos *dst, struct damos *src)
 {
+	bool activated = dst->wmarks.activated;
 	int err;
 
 	dst->pattern = src->pattern;
@@ -1578,6 +1579,8 @@ static int damos_commit(struct damos *dst, struct damos *src)
 		return err;
 
 	dst->wmarks = src->wmarks;
+	if (dst->wmarks.metric != DAMOS_WMARK_NONE)
+		dst->wmarks.activated = activated;
 	dst->target_nid = src->target_nid;
 
 	err = damos_commit_dests(&dst->migrate_dests, &src->migrate_dests);
-- 
2.47.3

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* + mm-damon-stat-avoid-32-bit-overflow-in-idle-time-milliseconds.patch added to mm-hotfixes-unstable branch
  2026-11-23 15:00 ` [PATCH mm-hotfixes-unstable 1/3] mm/damon/stat: avoid 32-bit overflow in idle time milliseconds SJ Park
@ 2026-11-23 17:48   ` Andrew Morton
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew Morton @ 2026-11-23 17:48 UTC (permalink / raw)
  To: mm-commits, stable, sj, jm5905938, evanfengff, devnexen, akpm


The patch titled
     Subject: mm/damon/stat: avoid 32-bit overflow in idle time milliseconds
has been added to the -mm mm-hotfixes-unstable branch.  Its filename is
     mm-damon-stat-avoid-32-bit-overflow-in-idle-time-milliseconds.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-damon-stat-avoid-32-bit-overflow-in-idle-time-milliseconds.patch

This patch will later appear in the mm-hotfixes-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days

------------------------------------------------------
From: David Carlier <devnexen@gmail.com>
Subject: mm/damon/stat: avoid 32-bit overflow in idle time milliseconds
Date: Mon, 23 Nov 2026 07:00:46 -0800

Patch series "mm/damon: three fixes for idle_time overflow and damos_walk()
hang".

Avoid 32-bit overflow of idle time calculation in DAMON_STAT, via
patch 1 from David Carlier.  Fix a damos_walk() hang that can happen
under certain watermarks setup and a watermarks commit internal state
overwrite issue, via patches 2 and 3 from Yifan Feng.

This is a batched reposting of separately posted and reviewed patches
for being merged into the mm.git.  Refer to changelog on each patch for
changes that were made before this reposting.


This patch (of 3):

On 32-bit, the region idle time in microseconds is computed in a long
before the division to milliseconds. It wraps once a region has been
idle for about 36 minutes regardless of the intervals, so the cold end
of memory_idle_ms_percentiles reports wrong values with flipped signs.

Do the multiplication in 64 bits and divide with div_s64() so the sign
of recently accessed regions is kept.

Link: https://lore.kernel.org/20261123150049.81317-1-sj@kernel.org
Link: https://patch.msgid.link/20261123150049.81317-2-sj@kernel.org
Fixes: e5d2585d9e85 ("mm/damon/stat: calculate and expose idle time percentiles")
Signed-off-by: David Carlier <devnexen@gmail.com>
Signed-off-by: SJ Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: SJ Park <sj@kernel.org>
Cc: Aveline Noir <jm5905938@gmail.com>
Cc: Yifan Feng <evanfengff@gmail.com>
Cc: <stable@vger.kernel.org>

 mm/damon/stat.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/mm/damon/stat.c~mm-damon-stat-avoid-32-bit-overflow-in-idle-time-milliseconds
+++ a/mm/damon/stat.c
@@ -129,8 +129,8 @@ static void damon_stat_set_idletime_perc
 		accounted_bytes += region->ar.end - region->ar.start;
 		while (next_percentile <= accounted_bytes * 100 / total_sz)
 			memory_idle_ms_percentiles[next_percentile++] =
-				damon_stat_idletime(region) *
-				(long)c->attrs.aggr_interval / USEC_PER_MSEC;
+				div_s64((s64)damon_stat_idletime(region) *
+				c->attrs.aggr_interval, USEC_PER_MSEC);
 	}
 	kfree(sorted_regions);
 }
_

Patches currently in -mm which might be from devnexen@gmail.com are

mm-damon-stat-avoid-32-bit-overflow-in-idle-time-milliseconds.patch


^ permalink raw reply	[flat|nested] 7+ messages in thread

* + mm-damon-core-fix-damos_walk-hang-with-zero-watermarks-interval.patch added to mm-hotfixes-unstable branch
  2026-11-23 15:00 ` [PATCH mm-hotfixes-unstable 2/3] mm/damon/core: fix damos_walk() hang with zero watermarks interval SJ Park
@ 2026-11-23 17:48   ` Andrew Morton
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew Morton @ 2026-11-23 17:48 UTC (permalink / raw)
  To: mm-commits, stable, sj, devnexen, evanfengff, akpm


The patch titled
     Subject: mm/damon/core: fix damos_walk() hang with zero watermarks interval
has been added to the -mm mm-hotfixes-unstable branch.  Its filename is
     mm-damon-core-fix-damos_walk-hang-with-zero-watermarks-interval.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-damon-core-fix-damos_walk-hang-with-zero-watermarks-interval.patch

This patch will later appear in the mm-hotfixes-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days

------------------------------------------------------
From: Yifan Feng <evanfengff@gmail.com>
Subject: mm/damon/core: fix damos_walk() hang with zero watermarks interval
Date: Mon, 23 Nov 2026 07:00:47 -0800

kdamond_wait_activation() cancels damos_walk() requests while all
schemes are deactivated by their watermarks.  But it returns without
waiting when the watermarks check interval of a deactivated scheme is
zero, which is the default of the DAMON sysfs interface.  The kdamond
main loop then runs with all schemes deactivated.

In that state, kdamond_apply_schemes() finds no scheme to apply and
returns before it calls damos_walk_complete().  The walk request is
neither completed nor cancelled, so damos_walk() waits until the
watermarks activate a scheme again, possibly forever.

For example, with a scheme that has the free_mem_rate metric, zero
interval_us and a high watermark below the current free memory rate,
writing update_schemes_tried_regions to the kdamond state file never
returns and cannot be killed.  The writer holds damon_sysfs_lock, so all
other DAMON sysfs writes including "off" fail with -EBUSY meanwhile.

Cancel the walk request in kdamond_apply_schemes() when no scheme is
activated, as kdamond_wait_activation() does for a non-zero interval.

Link: https://patch.msgid.link/20261123150049.81317-3-sj@kernel.org
Link: https://lore.kernel.org/20261121025626.75981-1-evanfengff@gmail.com
Fixes: bf0eaba0ff9c ("mm/damon/core: implement damos_walk()")
Signed-off-by: Yifan Feng <evanfengff@gmail.com>
Signed-off-by: SJ Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Suggested-by: SJ Park <sj@kernel.org>
Reviewed-by: SJ Park <sj@kernel.org>
Cc: David Carlier <devnexen@gmail.com>
Cc: <stable@vger.kernel.org> # 6.14.x

 mm/damon/core.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

--- a/mm/damon/core.c~mm-damon-core-fix-damos_walk-hang-with-zero-watermarks-interval
+++ a/mm/damon/core.c
@@ -3492,9 +3492,13 @@ static noinline_for_stack void kdamond_a
 	struct damon_target *t;
 	struct damos *s;
 	bool has_schemes_to_apply = false;
+	bool has_activated_schemes = false;
 	unsigned long max_region_sz;
 
 	damon_for_each_scheme(s, c) {
+		if (s->wmarks.activated)
+			has_activated_schemes = true;
+
 		if (time_before(c->passed_sample_intervals, s->next_apply_sis))
 			continue;
 
@@ -3506,8 +3510,12 @@ static noinline_for_stack void kdamond_a
 		damos_adjust_quota(c, s);
 	}
 
-	if (!has_schemes_to_apply)
+	if (!has_schemes_to_apply) {
+		/* The walk cannot be completed while no scheme is activated */
+		if (!has_activated_schemes)
+			damos_walk_cancel(c);
 		return;
+	}
 
 	max_region_sz = damon_region_sz_limit(c);
 	mutex_lock(&c->walk_control_lock);
_

Patches currently in -mm which might be from evanfengff@gmail.com are

mm-damon-core-fix-damos_walk-hang-with-zero-watermarks-interval.patch
mm-damon-core-do-not-overwrite-wmarksactivated-in-damos_commit.patch


^ permalink raw reply	[flat|nested] 7+ messages in thread

* + mm-damon-core-do-not-overwrite-wmarksactivated-in-damos_commit.patch added to mm-hotfixes-unstable branch
  2026-11-23 15:00 ` [PATCH mm-hotfixes-unstable 3/3] mm/damon/core: do not overwrite wmarks.activated in damos_commit() SJ Park
@ 2026-11-23 17:48   ` Andrew Morton
  0 siblings, 0 replies; 7+ messages in thread
From: Andrew Morton @ 2026-11-23 17:48 UTC (permalink / raw)
  To: mm-commits, stable, sj, devnexen, evanfengff, akpm


The patch titled
     Subject: mm/damon/core: do not overwrite wmarks.activated in damos_commit()
has been added to the -mm mm-hotfixes-unstable branch.  Its filename is
     mm-damon-core-do-not-overwrite-wmarksactivated-in-damos_commit.patch

This patch will shortly appear at
     https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-damon-core-do-not-overwrite-wmarksactivated-in-damos_commit.patch

This patch will later appear in the mm-hotfixes-unstable branch at
    git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next via various
branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there most days

------------------------------------------------------
From: Yifan Feng <evanfengff@gmail.com>
Subject: mm/damon/core: do not overwrite wmarks.activated in damos_commit()
Date: Mon, 23 Nov 2026 07:00:48 -0800

damos_commit() copies the whole wmarks struct from the source scheme,
including the private 'activated' field.  The source scheme is a new
one, so the field is always true there.

As a result, a commit turns on a scheme that the watermarks turned off.
If the metric is between mid and high at that time, the scheme keeps
running, though it should stay off until the metric goes below mid.
DAMON_RECLAIM and DAMON_LRU_SORT use the same path for commit_inputs.

Save 'activated' before the copy and restore it after.  Do not restore
it for DAMOS_WMARK_NONE, because nothing sets it again in that case and
the scheme would stay off.

Link: https://patch.msgid.link/20261123150049.81317-4-sj@kernel.org
Fixes: 9cb3d0b9dfce ("mm/damon/core: implement DAMON context commit function")
Signed-off-by: Yifan Feng <evanfengff@gmail.com>
Signed-off-by: SJ Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: SJ Park <sj@kernel.org>
Cc: David Carlier <devnexen@gmail.com>
Cc: <stable@vger.kernel.org> # 6.11.x

 mm/damon/core.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/mm/damon/core.c~mm-damon-core-do-not-overwrite-wmarksactivated-in-damos_commit
+++ a/mm/damon/core.c
@@ -1567,6 +1567,7 @@ static struct damos *damon_nth_scheme(in
 
 static int damos_commit(struct damos *dst, struct damos *src)
 {
+	bool activated = dst->wmarks.activated;
 	int err;
 
 	dst->pattern = src->pattern;
@@ -1578,6 +1579,8 @@ static int damos_commit(struct damos *ds
 		return err;
 
 	dst->wmarks = src->wmarks;
+	if (dst->wmarks.metric != DAMOS_WMARK_NONE)
+		dst->wmarks.activated = activated;
 	dst->target_nid = src->target_nid;
 
 	err = damos_commit_dests(&dst->migrate_dests, &src->migrate_dests);
_

Patches currently in -mm which might be from evanfengff@gmail.com are

mm-damon-core-fix-damos_walk-hang-with-zero-watermarks-interval.patch
mm-damon-core-do-not-overwrite-wmarksactivated-in-damos_commit.patch


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-11-23 17:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-23 15:00 [PATCH mm-hotfixes-unstable 0/3] mm/damon: three fixes for idle_time overflow and damos_walk() hang SJ Park
2026-11-23 15:00 ` [PATCH mm-hotfixes-unstable 1/3] mm/damon/stat: avoid 32-bit overflow in idle time milliseconds SJ Park
2026-11-23 17:48   ` + mm-damon-stat-avoid-32-bit-overflow-in-idle-time-milliseconds.patch added to mm-hotfixes-unstable branch Andrew Morton
2026-11-23 15:00 ` [PATCH mm-hotfixes-unstable 2/3] mm/damon/core: fix damos_walk() hang with zero watermarks interval SJ Park
2026-11-23 17:48   ` + mm-damon-core-fix-damos_walk-hang-with-zero-watermarks-interval.patch added to mm-hotfixes-unstable branch Andrew Morton
2026-11-23 15:00 ` [PATCH mm-hotfixes-unstable 3/3] mm/damon/core: do not overwrite wmarks.activated in damos_commit() SJ Park
2026-11-23 17:48   ` + mm-damon-core-do-not-overwrite-wmarksactivated-in-damos_commit.patch added to mm-hotfixes-unstable branch Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox