Re: [PATCH v2 4/4] mm: memcontrol: fix unexpected massive positive number in memcg_state_val_in_pages()

Lorenzo Stoakes (Oracle)
2026-03-26T09:21:34Z

On Thu, Mar 26, 2026 at 09:16:50AM +0000, Lorenzo Stoakes (Oracle) wrote:
> /* Get the absolute value of (val * unit / PAGE_SIZE). */
> res = mult_frac(abs(val), unit, PAGE_SIZE);
> /* Round up zero values. */
> res = res ?: 1;
> /* Retain sign. */
> return val < 0 ? -res : res;

(If you think the comments are too much, you can drop them, and the code
essentially spells it out anyway)

Cheers, Lorenzo