Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751768AbdI1EhG (ORCPT ); Thu, 28 Sep 2017 00:37:06 -0400 Received: from www262.sakura.ne.jp ([202.181.97.72]:11148 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750821AbdI1EhF (ORCPT ); Thu, 28 Sep 2017 00:37:05 -0400 Subject: Re: [PATCH 0/2 v8] oom: capture unreclaimable slab info in oom message To: Yang Shi , mhocko@kernel.org Cc: cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <1506548776-67535-1-git-send-email-yang.s@alibaba-inc.com> From: Tetsuo Handa Message-ID: Date: Thu, 28 Sep 2017 13:36:57 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1506548776-67535-1-git-send-email-yang.s@alibaba-inc.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 635 Lines: 16 On 2017/09/28 6:46, Yang Shi wrote: > Changelog v7 —> v8: > * Adopted Michal’s suggestion to dump unreclaim slab info when unreclaimable slabs amount > total user memory. Not only in oom panic path. Holding slab_mutex inside dump_unreclaimable_slab() was refrained since V2 because there are mutex_lock(&slab_mutex); kmalloc(GFP_KERNEL); mutex_unlock(&slab_mutex); users. If we call dump_unreclaimable_slab() for non OOM panic path, aren't we introducing a risk of crash (i.e. kernel panic) for regular OOM path? We can try mutex_trylock() from dump_unreclaimable_slab() at best. But it is still remaining unsafe, isn't it?