Re: [PATCH v2 11/28] mm: slub: implement SLUB version of obj_to_index()

From: Johannes Weiner
Date: Mon Feb 03 2020 - 12:46:32 EST


On Mon, Jan 27, 2020 at 09:34:36AM -0800, Roman Gushchin wrote:
> This commit implements SLUB version of the obj_to_index() function,
> which will be required to calculate the offset of obj_cgroup in the
> obj_cgroups vector to store/obtain the objcg ownership data.
>
> To make it faster, let's repeat the SLAB's trick introduced by
> commit 6a2d7a955d8d ("[PATCH] SLAB: use a multiply instead of a
> divide in obj_to_index()") and avoid an expensive division.
>
> Signed-off-by: Roman Gushchin <guro@xxxxxx>
> Acked-by: Christoph Lameter <cl@xxxxxxxxx>

Acked-by: Johannes Weiner <hannes@xxxxxxxxxxx>