Re: [PATCH] mm: memcg: add NULL check to obj_cgroup_put()

From: Roman Gushchin
Date: Sat Mar 16 2024 - 17:10:26 EST


On Sat, Mar 16, 2024 at 01:58:03AM +0000, Yosry Ahmed wrote:
> 9 out of 16 callers perform a NULL check before calling
> obj_cgroup_put(). Move the NULL check in the function, similar to
> mem_cgroup_put(). The unlikely() NULL check in current_objcg_update()
> was left alone to avoid dropping the unlikey() annotation as this a fast
> path.
>
> Signed-off-by: Yosry Ahmed <yosryahmed@xxxxxxxxxx>

Acked-by: Roman Gushchin <roman.gushchin@xxxxxxxxx>

Thanks!