Re: [PATCH v2 5/6] mm: memcg/slab: cache page number in memcg_(un)charge_slab()

From: Shakeel Butt
Date: Fri Jan 10 2020 - 19:28:35 EST


On Thu, Jan 9, 2020 at 12:27 PM Roman Gushchin <guro@xxxxxx> wrote:
>
> There are many places in memcg_charge_slab() and memcg_uncharge_slab()
> which are calculating the number of pages to charge, css references to
> grab etc depending on the order of the slab page.
>
> Let's simplify the code by calculating it once and caching in the
> local variable.
>
> Signed-off-by: Roman Gushchin <guro@xxxxxx>

Reviewed-by: Shakeel Butt <shakeelb@xxxxxxxxxx>