]> git.baikalelectronics.ru Git - kernel.git/commit
slab: remove /proc/slab_allocators
authorQian Cai <cai@lca.pw>
Thu, 16 May 2019 19:57:41 +0000 (15:57 -0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 16 May 2019 22:51:55 +0000 (15:51 -0700)
commit6a068359e34523387047d4071b00ee92c06941f7
treec5719939c6bccf3a52a92795539cb9dfdf0bba35
parent43bce07d1058ad1caaf8e798b85e63fb1508f860
slab: remove /proc/slab_allocators

It turned out that DEBUG_SLAB_LEAK is still broken even after recent
recue efforts that when there is a large number of objects like
kmemleak_object which is normal on a debug kernel,

  # grep kmemleak /proc/slabinfo
  kmemleak_object   2243606 3436210 ...

reading /proc/slab_allocators could easily loop forever while processing
the kmemleak_object cache and any additional freeing or allocating
objects will trigger a reprocessing. To make a situation worse,
soft-lockups could easily happen in this sitatuion which will call
printk() to allocate more kmemleak objects to guarantee an infinite
loop.

Also, since it seems no one had noticed when it was totally broken
more than 2-year ago - see the commit bf0cdc28b35c ("slab: fix a crash
by reading /proc/slab_allocators"), probably nobody cares about it
anymore due to the decline of the SLAB. Just remove it entirely.

Suggested-by: Vlastimil Babka <vbabka@suse.cz>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Qian Cai <cai@lca.pw>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/slab_def.h
lib/Kconfig.debug
mm/slab.c