Re: [PATCH v9] mm/damon: add node_eligible_mem_bp goal metric
From: SeongJae Park
Date: Sun Apr 26 2026 - 19:03:41 EST
[...]
> Changes since v8:
> =================
> https://lore.kernel.org/linux-mm/20260426003245.2687-1-ravis.opensrc@xxxxxxxxx/
>
> - Removed unnecessary casts in mult_frac() call to fix potential
> divide-by-zero on 32-bit PAE systems (Sashiko/SJ review)
> - Kept original parameter name 'ctx' in damos_set_effective_quota()
> to avoid unnecessary diff (SJ review)
[...]
> +static unsigned long damos_get_node_eligible_mem_bp(struct damon_ctx *c,
> + struct damos *s, int nid)
> +{
> + phys_addr_t total_eligible = 0;
> + phys_addr_t node_eligible;
> +
> + if (c->ops.id != DAMON_OPS_PADDR)
> + return 0;
> +
> + if (nid < 0 || nid >= MAX_NUMNODES || !node_online(nid))
> + return 0;
> +
> + node_eligible = damos_calc_eligible_bytes(c, s, nid, &total_eligible);
> +
> + if (!total_eligible)
> + return 0;
> +
> + return mult_frac(node_eligible, 10000, total_eligible);
> +}
Sashiko found [1] this can cause __udivdi3 linking issue on 32bit machine with
CONFIG_PHYS_ADDR_T_64BIT. Seems that is correct to me. I believe below
attaching fixup can fix it?
Ravi, if my fixup looks good to you, could you please post another version
(say, v9.1) for another Sashiko review round?
[1] https://lore.kernel.org/20260426220409.95B26C2BCAF@xxxxxxxxxxxxxxx
Thanks,
SJ
[...]
=== >8 ===