From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796044118; b=jcmLu5JpUYZygnBy+TC7OYj2aVDud+awOjeHUzEJuMABNyhviKx3iJtDXyq9hKYAQ79d t2XcVEK3D3OBEnk+U6M/IPjB6pVftLI+NytlK8oOS/+iiq4HWTxIiRCsmOlom47bAKhgR KajOosCq67rl6phrSp6GCZSiYM59yfgWFxmZYq2JsQkEdvTnYKa0OsYprjBCw6gCZ3WuD ilVCHTzuwef/kvcvzTY4JqECtELK/L0NLRhYUUeay8tAeqz1pEaCQiqP5l5gXZ2sx4lyt GJudANrQSO0ywwFx9dIad7X+CZw2qI4X9ABdItQC67FRXtXu9HInvlw3AQpGFHz7VVQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796044118; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=CXskFgDZNBnHa3A6/kFxd/xXhgIgLjXKYo+UpHQ8fsg=; b=zwBBwYT9QUMPTNAihSoBHiwGHFIAsq6ek7zLgMONFvw0Nl5whoLFsojxXGKdzbkL01Ut 7wIcd6lxSDt7WN91QiUJUEn5gBo5JECvtVhWq5cYS5lwq1Q3S9BcMN9eLpGp9gDm/xC+Z M/Vsvrs3zAIT8ZenZb5t8ZTOw/Mij+x/KzpcRB00AMEhPpY385AGjBSC+eKiTPsyMHWzX 20Unw0tMvcqWIVzaJbfWGKSxHUI+xGxkH/lVFkZZAkTbhI4CK+c6ewcpcEDyaTPUwKuht hfz5uuj7jSbOoR6lzgZzs+uQskNuuBxkzQSwuLGeawVwhXTAI/XfCd6B4TG5SISWQaA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kRCbNbdn; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D0497606A31C for ; Mon, 30 Nov 2026 13:08:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=kRCbNbdn Received: by smtp.kernel.org (Postfix) with ESMTPSA id D331D1F00897; Mon, 30 Nov 2026 13:08:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796044118; bh=CXskFgDZNBnHa3A6/kFxd/xXhgIgLjXKYo+UpHQ8fsg=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=kRCbNbdngewm8beCKJ96V4MmJhIl+oq2AvCWYly3O2FiCkjQCp5TmF4PWTlV3gccR bnlZLAAxIYQ1ae3SaEXShWh9kkouOYPJKsT2JqBS7WySd4vGC7rPNtp9eovz62Ka7Y YBF9oZpvSikc/wbK9p9TA7xqna3O5LQw0L2userNNX6spBg/cAtrdcVGxNoUG7JghY ZVdKlHuwXI6GnD9ecXobGxhe/wR99VB5IXDnu6Pu6V1TU7N5ciqIacLo75I6llTjzR MtKIcIM4nPa/T6TyCYF3fl5XeyN5ApUJtdlR6XS4UHK+7YACxdleKddVY7tPGo1oz6 q9m+dvpcCrh2w== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH RFC] mm/damon/core: preserve region age differences during merging Reply-To: sashiko-reviews@lists.linux.dev To: "Aveline Noir" , "SJ Park" , "Andrew Morton" Cc: damon@lists.linux.dev, linux-mm@kvack.org In-Reply-To: <20261130-damon-preserve-region-age-v1-1-8701093ad356@gmail.com> References: <20261130-damon-preserve-region-age-v1-1-8701093ad356@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Mon, 30 Nov 2026 13:08:37 +0000 X-Mailing-List: damon@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] mm/damon/core: raw nr_accesses check in damon_merge_regions_of() -- commit 31ad98d8e8cfd0d1ff1566fceab291b4a0aa0418 Author: Aveline Noir mm/damon/core: preserve region age differences during merging This commit skips merging adjacent regions on the first merge pass in damon_merge_regions_of() if either region has no accesses and their age difference exceeds both 10 aggregation intervals and the younger region's age. > diff --git a/mm/damon/core.c b/mm/damon/core.c > index b791a2621bd62..70545b3e16ff3 100644 > --- a/mm/damon/core.c > +++ b/mm/damon/core.c > @@ -3745,6 +3745,11 @@ static void damon_merge_regions_of(struct damon_ta= rget *t, unsigned int thres, > goto set_prev_continue; > if (damon_sz_region(prev) + damon_sz_region(r) > sz_limit) > goto set_prev_continue; > + /* Preserve age differences for DAMOS on the first pass. */ > + if (count_age && (!r->nr_accesses || !prev->nr_accesses) && > + abs_diff(prev->age, r->age) > > + max(10U, min(prev->age, r->age))) > + goto set_prev_continue; [Severity: Medium] Should this check score and damon_merge_score(prev, false, ctx, use_probe_hits) instead of r->nr_accesses and prev->nr_accesses? When damon_has_probe_weights(ctx) is true, kdamond_fn() skips ctx->ops.check_accesses(ctx) and leaves nr_accesses at 0 for all regions. As a result, (!r->nr_accesses || !prev->nr_accesses) is always true when probe weights are configured, preventing adjacent actively accessed regions with non-zero probe-hit scores from merging whenever their ages differ. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261130-damon-pres= erve-region-age-v1-1-8701093ad356@gmail.com?part=3D1