Re: [PATCH v2 04/11] mm/damon/paddr: support addr_unit for DAMOS_LRU_[DE]PRIO

From: SeongJae Park
Date: Mon Aug 25 2025 - 23:06:20 EST


On Mon, 25 Aug 2025 08:13:53 -0700 SeongJae Park <sj@xxxxxxxxxx> wrote:

> On Fri, 22 Aug 2025 17:34:12 +0800 Quanmin Yan <yanquanmin1@xxxxxxxxxx> wrote:
>
> > From: SeongJae Park <sj@xxxxxxxxxx>
> >
> > Add support of addr_unit for DAMOS_LRU_PRIO and DAMOS_LRU_DEPRIO action
> > handling from the DAMOS operation implementation for the physical
> > address space.
> [...]
> > - return applied * PAGE_SIZE;
> > + return applied * PAGE_SIZE / addr_unit;
> > }
>
> This can cause __udivdi3 linking issue similar to the report [1] from kernel
> test robot. Andrew, could you please add below attaching fixup?
>
> [1] https://lore.kernel.org/oe-kbuild-all/202508241831.EKwdwXZL-lkp@xxxxxxxxx/

Hi Andrew, I posted three fixups for the __udivdi3 issue, and I see you picked
two of those in mm tree. But this one is not yet picked. Could you please
also add this fixup to mm tree?


Thanks,
SJ

>
>
> Thanks,
> SJ
>
> [...]
>
> ==== Attachment 0 (0002-mm-damon-paddr-use-do_div-on-i386-for-damon_pa_de_ac.patch) ====
> From hackermail Thu Jan 1 00:00:00 1970
> From: SeongJae Park <sj@xxxxxxxxxx>
> To: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Cc: SeongJae Park <sj@xxxxxxxxxx>
> Cc: damon@xxxxxxxxxxxxxxx
> Cc: kernel-team@xxxxxxxx
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> Cc: linux-mm@xxxxxxxxx
> Date: Mon, 25 Aug 2025 07:45:24 -0700
> Subject: [PATCH 2/3] mm/damon/paddr: use do_div() on i386 for
> damon_pa_de_activate() return value
>
> Otherwise, __udivdi3 linking issue happens on certain configs.
>
> Signed-off-by: SeongJae Park <sj@xxxxxxxxxx>
> ---
> mm/damon/paddr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/damon/paddr.c b/mm/damon/paddr.c
> index 09c87583af6c..6fb92ecc513d 100644
> --- a/mm/damon/paddr.c
> +++ b/mm/damon/paddr.c
> @@ -236,7 +236,7 @@ static inline unsigned long damon_pa_mark_accessed_or_deactivate(
> folio_put(folio);
> }
> s->last_applied = folio;
> - return applied * PAGE_SIZE / addr_unit;
> + return damon_pa_core_addr(applied * PAGE_SIZE, addr_unit);
> }
>
> static unsigned long damon_pa_mark_accessed(struct damon_region *r,
> --
> 2.39.5