Re: [PATCH v6 00/19] The new cgroup slab memory controller

From: Qian Cai
Date: Sun Jun 21 2020 - 19:53:28 EST




> On Jun 21, 2020, at 7:34 PM, Roman Gushchin <guro@xxxxxx> wrote:
>
> My wild guess is that kmemleak is getting confused by modifying the lowest
> bit of page->mem_cgroup/obhj_cgroups pointer:
>
> struct page {
> ...
> union {
> struct mem_cgroup *mem_cgroup;
> struct obj_cgroup **obj_cgroups;
> };
> ...
> }
>
> We're using the lowest bit to distinguish between a "normal" mem_cgroup
> pointer and a vector of obj_cgroup pointers.
>
> This pointer to obj_cgroup vector is saved only here, so if we're modifying
> the address, I guess it's what makes kmemleak think that there is a leak.
>
> Or do you have a real leak?

The point is that we canât have a patchset in the current form to totally render kmemleak useless with so many even false positives.

Anyway, this is rather easy to reproduce where I am able to reproduce on multiple bare-metal machines by just booting it.

# echo scan > /sys/kernel/debug/kmemleak
# cat /sys/kernel/debug/kmemleak