From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752006AbdJBPqn (ORCPT ); Mon, 2 Oct 2017 11:46:43 -0400 Received: from out0-231.mail.aliyun.com ([140.205.0.231]:57288 "EHLO out0-231.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751689AbdJBPqm (ORCPT ); Mon, 2 Oct 2017 11:46:42 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R751e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e02c03309;MF=yang.s@alibaba-inc.com;NM=1;PH=DS;RN=9;SR=0;TI=SMTPD_---.91X3WeF_1506959182; Subject: Re: [PATCH 0/2 v8] oom: capture unreclaimable slab info in oom message To: Michal Hocko , Tetsuo Handa 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> <20171002112051.uk4gyrtygfgtvp5g@dhcp22.suse.cz> From: "Yang Shi" Message-ID: <030a906a-c845-9639-8df3-2a48d11a1207@alibaba-inc.com> Date: Mon, 02 Oct 2017 23:46:14 +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: <20171002112051.uk4gyrtygfgtvp5g@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8; format=flowed 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 On 10/2/17 4:20 AM, Michal Hocko wrote: > On Thu 28-09-17 13:36:57, Tetsuo Handa wrote: >> 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? > > yes we are > >> We can try mutex_trylock() from dump_unreclaimable_slab() at best. >> But it is still remaining unsafe, isn't it? > > using the trylock sounds like a reasonable compromise. OK, it sounds we reach agreement on trylock. Will solve those comments in v9. Thanks, Yang >