* Re: [PATCH] mm/damon/paddr: avoid truncation warning in high-address KUnit test
2026-11-17 17:04 [PATCH] mm/damon/paddr: avoid truncation warning in high-address KUnit test Aveline Noir
@ 2026-11-17 17:19 ` sashiko-bot
2026-11-18 1:32 ` SJ Park
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-11-17 17:19 UTC (permalink / raw)
To: Aveline Noir; +Cc: damon
> Hi SJ, Andrew,
>
> The kernel test robot caught this issue in my earlier addr_unit KUnit
> patch. Feel free to fold this fix into that patch.
>
> Thanks,
> Aveline Noir
>
> -- >8 --
> When phys_addr_t is 32-bit, Sparse warns about truncating the u64 address
> passed to damon_pa_core_addr() in damon_test_pa_addr_over_4g(). The
> runtime kunit_skip() does not prevent Sparse from checking that
> conversion.
>
> Compile the high-address assertions only with CONFIG_PHYS_ADDR_T_64BIT,
> and keep the test skipped otherwise.
>
> Fixes: 7a983cc1b573 ("mm/damon/paddr: add KUnit tests for addr_unit conversion")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/20261117170155.fEdeuuhm-lkp@intel.com/
> Signed-off-by: Aveline Noir <jm5905938@gmail.com>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261118-fix-damon-paddr-sparse-20261118-v1-1-3a0e943406d5@gmail.com?part=1
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] mm/damon/paddr: avoid truncation warning in high-address KUnit test
2026-11-17 17:04 [PATCH] mm/damon/paddr: avoid truncation warning in high-address KUnit test Aveline Noir
2026-11-17 17:19 ` sashiko-bot
@ 2026-11-18 1:32 ` SJ Park
2026-11-18 13:18 ` Enze Li
2026-12-04 0:03 ` [folded-merged] mm-damon-paddr-add-kunit-tests-for-addr_unit-conversion-fix.patch removed from -mm tree Andrew Morton
3 siblings, 0 replies; 5+ messages in thread
From: SJ Park @ 2026-11-18 1:32 UTC (permalink / raw)
To: Aveline Noir
Cc: SJ Park, Andrew Morton, damon, David Hildenbrand, Justin Stitt,
lienze, linux-kernel, Linux Memory Management List,
kernel test robot, llvm, mm-commits, Bill Wendling,
Nathan Chancellor, Nick Desaulniers, oe-kbuild-all, rdunlap,
sashiko-bot, sashiko-reviews
Hi Aveline,
On Wed, 18 Nov 2026 04:04:33 +1100 Aveline Noir <jm5905938@gmail.com> wrote:
> Hi SJ, Andrew,
>
> The kernel test robot caught this issue in my earlier addr_unit KUnit
> patch. Feel free to fold this fix into that patch.
I will ping Andrew again on Thursday, if Andrew doesn't add this fixup to
mm.git by the time.
Thanks,
SJ
[...]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mm/damon/paddr: avoid truncation warning in high-address KUnit test
2026-11-17 17:04 [PATCH] mm/damon/paddr: avoid truncation warning in high-address KUnit test Aveline Noir
2026-11-17 17:19 ` sashiko-bot
2026-11-18 1:32 ` SJ Park
@ 2026-11-18 13:18 ` Enze Li
2026-12-04 0:03 ` [folded-merged] mm-damon-paddr-add-kunit-tests-for-addr_unit-conversion-fix.patch removed from -mm tree Andrew Morton
3 siblings, 0 replies; 5+ messages in thread
From: Enze Li @ 2026-11-18 13:18 UTC (permalink / raw)
To: Aveline Noir, SJ Park, Andrew Morton
Cc: damon, David Hildenbrand, Justin Stitt, linux-kernel,
Linux Memory Management List, kernel test robot, llvm, mm-commits,
Bill Wendling, Nathan Chancellor, Nick Desaulniers, oe-kbuild-all,
rdunlap, sashiko-bot, sashiko-reviews
On 2026/11/18 01:04, Aveline Noir wrote:
> Hi SJ, Andrew,
>
> The kernel test robot caught this issue in my earlier addr_unit KUnit
> patch. Feel free to fold this fix into that patch.
>
> Thanks,
> Aveline Noir
>
> -- >8 --
> When phys_addr_t is 32-bit, Sparse warns about truncating the u64 address
> passed to damon_pa_core_addr() in damon_test_pa_addr_over_4g(). The
> runtime kunit_skip() does not prevent Sparse from checking that
> conversion.
>
> Compile the high-address assertions only with CONFIG_PHYS_ADDR_T_64BIT,
> and keep the test skipped otherwise.
>
> Fixes: 7a983cc1b573 ("mm/damon/paddr: add KUnit tests for addr_unit conversion")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/20261117170155.fEdeuuhm-lkp@intel.com/
> Signed-off-by: Aveline Noir <jm5905938@gmail.com>
Reviewed-by: Enze Li <lienze@kylinos.cn>
Thanks,
Enze
> ---
> The reported warning is gone with the original i386 config, Clang 22.1.8
> and Sparse v0.6.5-rc1-21-g84ec0658. All executed DAMON KUnit tests passed
> on x86_64 and i386 with and without PAE; the high-address case skips
> without PAE.
> ---
> mm/damon/tests/paddr-kunit.h | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/mm/damon/tests/paddr-kunit.h b/mm/damon/tests/paddr-kunit.h
> index 9839cc233071..2b11f0e67a12 100644
> --- a/mm/damon/tests/paddr-kunit.h
> +++ b/mm/damon/tests/paddr-kunit.h
> @@ -26,15 +26,16 @@ static void damon_test_pa_core_addr(struct kunit *test)
>
> static void damon_test_pa_addr_over_4g(struct kunit *test)
> {
> +#ifdef CONFIG_PHYS_ADDR_T_64BIT
> unsigned long addr = 0xffffffffUL;
> unsigned long addr_unit = 0x1000;
> u64 pa = 0xffffffff000ULL;
>
> - if (!IS_ENABLED(CONFIG_PHYS_ADDR_T_64BIT))
> - kunit_skip(test, "phys_addr_t is 32-bit");
> -
> KUNIT_EXPECT_EQ(test, damon_pa_phys_addr(addr, addr_unit), pa);
> KUNIT_EXPECT_EQ(test, damon_pa_core_addr(pa, addr_unit), addr);
> +#else
> + kunit_skip(test, "phys_addr_t is 32-bit");
> +#endif
> }
>
> static struct kunit_case damon_paddr_test_cases[] = {
>
> ---
> base-commit: 7a983cc1b57309a875a9e07a934c9944bf3d088d
> change-id: 20261118-fix-damon-paddr-sparse-20261118-fb08902768d7
^ permalink raw reply [flat|nested] 5+ messages in thread* [folded-merged] mm-damon-paddr-add-kunit-tests-for-addr_unit-conversion-fix.patch removed from -mm tree
2026-11-17 17:04 [PATCH] mm/damon/paddr: avoid truncation warning in high-address KUnit test Aveline Noir
` (2 preceding siblings ...)
2026-11-18 13:18 ` Enze Li
@ 2026-12-04 0:03 ` Andrew Morton
3 siblings, 0 replies; 5+ messages in thread
From: Andrew Morton @ 2026-12-04 0:03 UTC (permalink / raw)
To: mm-commits, sj, rdunlap, ndesaulniers, nathan, morbo, lkp, lienze,
justinstitt, david, jm5905938, akpm
The quilt patch titled
Subject: mm/damon/paddr: avoid truncation warning in high-address KUnit test
has been removed from the -mm tree. Its filename was
mm-damon-paddr-add-kunit-tests-for-addr_unit-conversion-fix.patch
This patch was dropped because it was folded into mm-damon-paddr-add-kunit-tests-for-addr_unit-conversion.patch
------------------------------------------------------
From: Aveline Noir <jm5905938@gmail.com>
Subject: mm/damon/paddr: avoid truncation warning in high-address KUnit test
Date: Wed, 18 Nov 2026 04:04:33 +1100
When phys_addr_t is 32-bit, Sparse warns about truncating the u64 address
passed to damon_pa_core_addr() in damon_test_pa_addr_over_4g(). The
runtime kunit_skip() does not prevent Sparse from checking that
conversion.
Compile the high-address assertions only with CONFIG_PHYS_ADDR_T_64BIT,
and keep the test skipped otherwise.
Link: https://patch.msgid.link/20261118-fix-damon-paddr-sparse-20261118-v1-1-3a0e943406d5@gmail.com
Fixes: 7a983cc1b573 ("mm/damon/paddr: add KUnit tests for addr_unit conversion")
Signed-off-by: Aveline Noir <jm5905938@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/20261117170155.fEdeuuhm-lkp@intel.com/
Reviewed-by: Enze Li <lienze@kylinos.cn>
Cc: SJ Park <sj@kernel.org>
Cc: David Hildenbrand <david@kernel.org>
Cc: Justin Stitt <justinstitt@google.com>
Cc: Bill Wendling <morbo@google.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
mm/damon/tests/paddr-kunit.h | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--- a/mm/damon/tests/paddr-kunit.h~mm-damon-paddr-add-kunit-tests-for-addr_unit-conversion-fix
+++ a/mm/damon/tests/paddr-kunit.h
@@ -26,15 +26,16 @@ static void damon_test_pa_core_addr(stru
static void damon_test_pa_addr_over_4g(struct kunit *test)
{
+#ifdef CONFIG_PHYS_ADDR_T_64BIT
unsigned long addr = 0xffffffffUL;
unsigned long addr_unit = 0x1000;
u64 pa = 0xffffffff000ULL;
- if (!IS_ENABLED(CONFIG_PHYS_ADDR_T_64BIT))
- kunit_skip(test, "phys_addr_t is 32-bit");
-
KUNIT_EXPECT_EQ(test, damon_pa_phys_addr(addr, addr_unit), pa);
KUNIT_EXPECT_EQ(test, damon_pa_core_addr(pa, addr_unit), addr);
+#else
+ kunit_skip(test, "phys_addr_t is 32-bit");
+#endif
}
static struct kunit_case damon_paddr_test_cases[] = {
_
Patches currently in -mm which might be from jm5905938@gmail.com are
mm-damon-sysfs-skip-registration-if-damon-core-init-fails.patch
mm-damon-ops-common-align-mmu-notifier-range-when-clearing-pmd-young-bit.patch
mm-damon-stat-avoid-32-bit-overflow-in-idle-percentiles.patch
mm-damon-pvaddr-skip-folios-already-on-the-migration-target-node.patch
docs-admin-guide-mm-damon-start-fix-grammar.patch
docs-admin-guide-mm-damon-stat-fix-pronoun-agreement.patch
docs-admin-guide-mm-damon-usage-fix-grammar.patch
docs-admin-guide-mm-damon-lru_sort-fix-remaining-grammar.patch
docs-mm-damon-design-fix-grammar-and-typos.patch
docs-mm-damon-api-fix-verb-form.patch
docs-mm-damon-maintainer-profile-fix-subject-verb-agreement.patch
docs-mm-damon-monitoring_intervals_tuning_example-fix-grammar-and-typos.patch
mm-damon-paddr-add-kunit-tests-for-addr_unit-conversion.patch
mm-damon-paddr-skip-non-lru-folios-as-a-whole-in-pageout.patch
mm-damon-core-skip-apply_probes-when-no-probes-are-installed.patch
selftests-damon-damos_quota-skip-the-last-sample-when-counting-exceeds.patch
mm-hugetlb-serialize-subpool-release-with-folio-reserve-restoration.patch
^ permalink raw reply [flat|nested] 5+ messages in thread