Re: "mm: reparent slab memory on cgroup removal" series triggers SLUB_DEBUG errors

From: Qian Cai
Date: Wed Jun 19 2019 - 09:41:44 EST


On Wed, 2019-06-19 at 03:09 +0000, Roman Gushchin wrote:
> On Tue, Jun 18, 2019 at 05:43:04PM -0400, Qian Cai wrote:
> > Booting linux-next on both arm64 and powerpc triggers SLUB_DEBUG errors
> > below. Reverted the whole series âmm: reparent slab memory on cgroup
> > removalâ [1] fixed the issue.
>
> Hi Qian!
>
> Thank you for the report!
>
> Didn't you try to reproduce it on x86? All the code changed in this series
> isn't arch-specific, so if it can be seen only on ppc and arm64, that's
> interesting.

Yes, it is not reproducible on x86 yet.

>
> I'm currently on PTO and have a very limited internet connection,
> so I won't be able to reproduce the issue up to Sunday, when I'll be back.
>
> If you can try reverting only the last patch from the series,
> I will appreciate it.

No, that does not help.

>
> Thanks!
>
> >
> > [1] https://lore.kernel.org/lkml/20190611231813.3148843-1-guro@xxxxxx/
> >
> > [ÂÂ151.773224][ T1650] BUG kmem_cache (Tainted: GÂÂÂÂBÂÂÂWÂÂÂÂÂÂÂÂ): Poison
> > overwritten
> > [ÂÂ151.780969][ T1650] ---------------------------------------------------
> > --------------------------
> > [ÂÂ151.780969][ T1650]Â
> > [ÂÂ151.792016][ T1650] INFO: 0x000000001fd6fdef-0x0000000007f6bb36. First
> > byte 0x0 instead of 0x6b
> > [ÂÂ151.800726][ T1650] INFO: Allocated in create_cache+0x6c/0x1bc age=24301
> > cpu=97 pid=1444
> > [ÂÂ151.808821][ T1650]Â kmem_cache_alloc+0x514/0x568
> > [ÂÂ151.813527][ T1650]Â create_cache+0x6c/0x1bc
> > [ÂÂ151.817800][ T1650]Â memcg_create_kmem_cache+0xfc/0x11c
> > [ÂÂ151.823028][ T1650]Â memcg_kmem_cache_create_func+0x40/0x170
> > [ÂÂ151.828691][ T1650]Â process_one_work+0x4e0/0xa54
> > [ÂÂ151.833398][ T1650]Â worker_thread+0x498/0x650
> > [ÂÂ151.837843][ T1650]Â kthread+0x1b8/0x1d4
> > [ÂÂ151.841770][ T1650]Â ret_from_fork+0x10/0x18
> > [ÂÂ151.846046][ T1650] INFO: Freed in slab_kmem_cache_release+0x3c/0x48
> > age=23341 cpu=28 pid=1480
> > [ÂÂ151.854659][ T1650]Â slab_kmem_cache_release+0x3c/0x48
> > [ÂÂ151.859799][ T1650]Â kmem_cache_release+0x1c/0x28
> > [ÂÂ151.864507][ T1650]Â kobject_cleanup+0x134/0x288
> > [ÂÂ151.869127][ T1650]Â kobject_put+0x5c/0x68
> > [ÂÂ151.873226][ T1650]Â sysfs_slab_release+0x2c/0x38
> > [ÂÂ151.877931][ T1650]Â shutdown_cache+0x198/0x23c
> > [ÂÂ151.882464][ T1650]Â kmemcg_cache_shutdown_fn+0x1c/0x34
> > [ÂÂ151.887691][ T1650]Â kmemcg_workfn+0x44/0x68
> > [ÂÂ151.891963][ T1650]Â process_one_work+0x4e0/0xa54
> > [ÂÂ151.896668][ T1650]Â worker_thread+0x498/0x650
> > [ÂÂ151.901113][ T1650]Â kthread+0x1b8/0x1d4
> > [ÂÂ151.905037][ T1650]Â ret_from_fork+0x10/0x18
> > [ÂÂ151.909324][ T1650] INFO: Slab 0x00000000406d65a6 objects=64 used=64
> > fp=0x000000004d988e71 flags=0x7ffffffc000200
> > [ÂÂ151.919596][ T1650] INFO: Object 0x0000000040f4b79e
> > @offset=15420325124116637824 fp=0x00000000e038adbf
> > [ÂÂ151.919596][ T1650]Â
> > [ÂÂ151.931079][ T1650] Redzone 00000000fc4c04f0: bb bb bb bb bb bb bb bb bb
> > bb bb bb bb bb bb bbÂÂ................
> > [ÂÂ151.941168][ T1650] Redzone 000000009a25c019: bb bb bb bb bb bb bb bb bb
> > bb bb bb bb bb bb bbÂÂ................
> > [ÂÂ151.951256][ T1650] Redzone 000000000b05c7cc: bb bb bb bb bb bb bb bb bb
> > bb bb bb bb bb bb bbÂÂ................
> > [ÂÂ151.961345][ T1650] Redzone 00000000a08ae38b: bb bb bb bb bb bb bb bb bb
> > bb bb bb bb bb bb bbÂÂ................
> > [ÂÂ151.971433][ T1650] Redzone 00000000e0eccd41: bb bb bb bb bb bb bb bb bb
> > bb bb bb bb bb bb bbÂÂ................
> > [ÂÂ151.981520][ T1650] Redzone 0000000016ee2661: bb bb bb bb bb bb bb bb bb
> > bb bb bb bb bb bb bbÂÂ................
> > [ÂÂ151.991608][ T1650] Redzone 000000009364e729: bb bb bb bb bb bb bb bb bb
> > bb bb bb bb bb bb bbÂÂ................
> > [ÂÂ152.001695][ T1650] Redzone 00000000f2202456: bb bb bb bb bb bb bb bb bb
> > bb bb bb bb bb bb bbÂÂ................
> > [ÂÂ152.011784][ T1650] Object 0000000040f4b79e: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.021783][ T1650] Object 000000002df21fec: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.031779][ T1650] Object 0000000041cf0887: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.041775][ T1650] Object 00000000bfb91e8f: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.051770][ T1650] Object 00000000da315b1c: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.061765][ T1650] Object 00000000b362de78: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.071761][ T1650] Object 00000000ad4f72bf: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.081756][ T1650] Object 00000000aa32d346: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.091751][ T1650] Object 00000000ad1cf22c: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.101746][ T1650] Object 000000001cee47e4: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.111741][ T1650] Object 00000000418720ed: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.121736][ T1650] Object 00000000dee1c3f2: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.131731][ T1650] Object 00000000a23397c1: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.141727][ T1650] Object 000000002ed01641: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.151721][ T1650] Object 00000000915ec720: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.161716][ T1650] Object 00000000915988c1: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.171711][ T1650] Object 000000004a0cc60f: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.181707][ T1650] Object 0000000054a294c9: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.191701][ T1650] Object 0000000054f61682: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.201697][ T1650] Object 0000000018d04328: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.211692][ T1650] Object 00000000703cf2c7: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.221687][ T1650] Object 000000004d3ac5d5: 6b 6b 6b 6b 6b 6b 6b 6b 00
> > 00 00 00 00 00 00 00ÂÂkkkkkkkk........
> > [ÂÂ152.231682][ T1650] Object 00000000726ce587: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.241676][ T1650] Object 00000000c709b64e: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.251672][ T1650] Object 0000000044d6a5c6: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.261667][ T1650] Object 000000009c76a6a2: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.271662][ T1650] Object 0000000033d01d12: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.281657][ T1650] Object 00000000c50ff26f: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.291652][ T1650] Object 00000000ebc3aaae: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.301647][ T1650] Object 00000000a2072fe3: 6b 6b 6b 6b 6b 6b 6b 6b 6b
> > 6b 6b 6b 6b 6b 6b 6bÂÂkkkkkkkkkkkkkkkk
> > [ÂÂ152.311641][ T1650] Object 000000003d5911a3: 6b 6b 6b 6b 6b 6b 6b
> > a5ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂkkkkkkk.
> > [ÂÂ152.320942][ T1650] Redzone 000000009a2feac1: bb bb bb bb bb bb bb
> > bbÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ........
> > [ÂÂ152.330330][ T1650] Padding 00000000c1b3cb8b: 5a 5a 5a 5a 5a 5a 5a 5a 5a
> > 5a 5a 5a 5a 5a 5a 5aÂÂZZZZZZZZZZZZZZZZ
> > [ÂÂ152.340412][ T1650] Padding 000000003715421a: 5a 5a 5a 5a 5a 5a 5a 5a 5a
> > 5a 5a 5a 5a 5a 5a 5aÂÂZZZZZZZZZZZZZZZZ
> > [ÂÂ152.350493][ T1650] Padding 0000000066b51ba7: 5a 5a 5a 5a 5a 5a 5a 5a 5a
> > 5a 5a 5a 5a 5a 5a 5aÂÂZZZZZZZZZZZZZZZZ
> > [ÂÂ152.360575][ T1650] Padding 00000000ca240306: 5a 5a 5a 5a 5a 5a 5a 5a 5a
> > 5a 5a 5a 5a 5a 5a 5aÂÂZZZZZZZZZZZZZZZZ
> > [ÂÂ152.370657][ T1650] Padding 0000000014a2af5d: 5a 5a 5a 5a 5a 5a 5a
> > 5aÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂZZZZZZZZ
> > [ÂÂ152.380048][ T1650] CPU: 82 PID: 1650 Comm: kworker/82:1 Tainted:
> > GÂÂÂÂBÂÂÂWÂÂÂÂÂÂÂÂÂ5.2.0-rc5-next-20190617 #18
> > [ÂÂ152.390216][ T1650] Hardware name: HPE Apollo
> > 70ÂÂÂÂÂÂÂÂÂÂÂÂÂ/C01_APACHE_MBÂÂÂÂÂÂÂÂÂ, BIOS L50_5.13_1.0.9 03/01/2019
> > [ÂÂ152.400741][ T1650] Workqueue: memcg_kmem_cache
> > memcg_kmem_cache_create_func
> > [ÂÂ152.407786][ T1650] Call trace:
> > [ÂÂ152.410926][ T1650]ÂÂdump_backtrace+0x0/0x268
> > [ÂÂ152.415280][ T1650]ÂÂshow_stack+0x20/0x2c
> > [ÂÂ152.419287][ T1650]ÂÂdump_stack+0xb4/0x108
> > [ÂÂ152.423384][ T1650]ÂÂprint_trailer+0x274/0x298
> > [ÂÂ152.427825][ T1650]ÂÂcheck_bytes_and_report+0xc4/0x118
> > [ÂÂ152.432959][ T1650]ÂÂcheck_object+0x2fc/0x36c
> > [ÂÂ152.437312][ T1650]ÂÂalloc_debug_processing+0x154/0x240
> > [ÂÂ152.442532][ T1650]ÂÂ___slab_alloc+0x710/0xa68
> > [ÂÂ152.446972][ T1650]ÂÂkmem_cache_alloc+0x514/0x568
> > [ÂÂ152.451672][ T1650]ÂÂcreate_cache+0x6c/0x1bc
> > [ÂÂ152.455938][ T1650]ÂÂmemcg_create_kmem_cache+0xfc/0x11c
> > [ÂÂ152.461158][ T1650]ÂÂmemcg_kmem_cache_create_func+0x40/0x170
> > [ÂÂ152.466814][ T1650]ÂÂprocess_one_work+0x4e0/0xa54
> > [ÂÂ152.471515][ T1650]ÂÂworker_thread+0x498/0x650
> > [ÂÂ152.475953][ T1650]ÂÂkthread+0x1b8/0x1d4
> > [ÂÂ152.479872][ T1650]ÂÂret_from_fork+0x10/0x18
> > [ÂÂ152.484139][ T1650] FIX kmem_cache: Restoring 0x000000001fd6fdef-
> > 0x0000000007f6bb36=0x6b
> > [ÂÂ152.484139][ T1650]Â
> > [ÂÂ152.494395][ T1650] FIX kmem_cache: Marking all objects used