Re: [PATCH v1 2/2] tools/mm: slabinfo: preserve the average partial object count
From: Harry Yoo
Date: Wed Dec 02 2026 - 13:26:00 EST
On Wed, Nov 18, 2026 at 02:03:17PM +0800, Xuewen Wang wrote:
> From: Xuewen Wang <wangxuewen@xxxxxxxxxx>
>
> totals() calculates avg_partobj as total_partobj / used_slabs, but then
> overwrites it with total_partobj * 100 / total_objects. Consequently,
> the PartObjs Average column of -T and -X reports a percentage instead
> of an object count per cache.
>
> Remove the second assignment. The aggregate partial-object percentage
> is already calculated where it is printed, and avg_ppartobj separately
> holds the average per-cache percentage.
>
> Fixes: c09d87517298 ("slub: add slabinfo tool")
> Signed-off-by: Xuewen Wang <wangxuewen@xxxxxxxxxx>
> ---
Looks good to me,
Acked-by: Harry Yoo (Meta) <harry@xxxxxxxxxx>
--
Cheers,
Harry / Hyeonggon