Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751892AbdI0RV4 (ORCPT ); Wed, 27 Sep 2017 13:21:56 -0400 Received: from out0-249.mail.aliyun.com ([140.205.0.249]:44433 "EHLO out0-249.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750852AbdI0RVy (ORCPT ); Wed, 27 Sep 2017 13:21:54 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R391e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e02c03278;MF=yang.s@alibaba-inc.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---.9.5KKv5_1506532892; Subject: Re: [PATCH 2/3] mm: oom: show unreclaimable slab info when kernel panic To: Christopher Lameter Cc: penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, mhocko@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <1506473616-88120-1-git-send-email-yang.s@alibaba-inc.com> <1506473616-88120-3-git-send-email-yang.s@alibaba-inc.com> From: "Yang Shi" Message-ID: Date: Thu, 28 Sep 2017 01:21:27 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1156 Lines: 38 On 9/27/17 12:14 AM, Christopher Lameter wrote: > On Wed, 27 Sep 2017, Yang Shi wrote: > >> Print out unreclaimable slab info (used size and total size) which >> actual memory usage is not zero (num_objs * size != 0) when: >> - unreclaimable slabs : all user memory > unreclaim_slabs_oom_ratio >> - panic_on_oom is set or no killable process > > Ok. I like this much more than the earlier releases. > >> diff --git a/mm/slab.h b/mm/slab.h >> index 0733628..b0496d1 100644 >> --- a/mm/slab.h >> +++ b/mm/slab.h >> @@ -505,6 +505,14 @@ static inline struct kmem_cache_node *get_node(struct kmem_cache *s, int node) >> void memcg_slab_stop(struct seq_file *m, void *p); >> int memcg_slab_show(struct seq_file *m, void *p); >> >> +#ifdef CONFIG_SLABINFO >> +void dump_unreclaimable_slab(void); >> +#else >> +static inline void dump_unreclaimable_slab(void) >> +{ >> +} >> +#endif > > CONFIG_SLABINFO? How does this relate to the oom info? /proc/slabinfo > support is optional. Oom info could be included even if CONFIG_SLABINFO > goes away. Remove the #ifdef? Because we want to dump the unreclaimable slab info in oom info. Thanks, Yang >