Per the suggestion from David [1], this implementation dumps single slab cache if its size is over 10% of total system memory. In current implementation, the ration is fixed as 10%.
To get the size of total system memory patch #1 extract the common code from show_mem() so that the code can be used by checking the ratio. The patchset is based on the mmotm tree. [1] https://marc.info/?l=linux-mm&m=150819933626604&w=2 Yang Shi (2): mm: extract common code for calculating total memory size mm: oom: dump single excessive slab cache when oom include/linux/mm.h | 25 +++++++++++++++++++++++++ lib/show_mem.c | 20 +------------------- mm/oom_kill.c | 22 +--------------------- mm/slab.h | 4 ++-- mm/slab_common.c | 21 ++++++++++++++++----- 5 files changed, 45 insertions(+), 47 deletions(-)