Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp6255000ybl; Wed, 15 Jan 2020 01:20:30 -0800 (PST) X-Google-Smtp-Source: APXvYqyWI2hp6A2eegl/RrgMfzAXMeZS+1Ltg2H49z8dp3jXlVyiBaOkqJYWL4WQ6h8PbckliWht X-Received: by 2002:aca:f1c6:: with SMTP id p189mr20850946oih.159.1579080030092; Wed, 15 Jan 2020 01:20:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579080030; cv=none; d=google.com; s=arc-20160816; b=Q0cbKp0vE4o+AtnAXy8YWF6+a+8CKqJJwaKE0RRnHkcyThsHqJ7D/SrPyHvIbUVVZM Er1tDXXaS/hf0Z2u/1U+OPGM85Dd4bKXprhY0tE8/hQya7GBgHPp52JR0jF/AqSu4N9y wN1IQWWt2jwS8sWfY6ScmpkTtyYb5kQaMWnIs6Llo7We2mXHOcmaDBT6SSnrVt099NNv P7alhWK38lkXA/Kpo6JntomMkXgGiBHoqxwNYBJOJrvMDm8w9ohnXrtk0hTNLhuOIEus u3sSg4c9i1JgU2J1rLoNG3zOGK2x2Q8gH7MqVy62+o6VO8EkoUGHyANVzoec8rISJpBo ze+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=ihbL3f6LFUcj5zTsyO8Z6mI05lsfmuOM3FW/oYXo5Kw=; b=VVOftl/+nhl9l2kNMJaZ4NFkODYk2WX72DkrYTxLPLmdxHTUKWd/lcuDo3L1EBGs6l PumEsQa0apebogo8177KgFRG3lIBp4OIgNyWDwjS/zlTDb7nOiQLwtDmoUCCA3YdTaCT Y3diJiyxdthU9zIZzRF9lPl81C0MT4vuDxBIOlfl7wvReCPNxXhyK8BOvHVXWeJ1Dmjq IGcpU7q1xoL1qBmN3SpDjJbuIcw+JC7NBSzFjD5pGe9/8Sg4FdSjRM8oy80JHBxV0NM2 PfOKXErjt3zMx6UgY7tU2Sr6rQH2k8o6eY2SBmYT75Duyoh+z+gncCGXND3Y/eKxpCrJ oxTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i5si10222439otr.293.2020.01.15.01.20.17; Wed, 15 Jan 2020 01:20:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729463AbgAOJSr (ORCPT + 99 others); Wed, 15 Jan 2020 04:18:47 -0500 Received: from www262.sakura.ne.jp ([202.181.97.72]:61079 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729377AbgAOJSq (ORCPT ); Wed, 15 Jan 2020 04:18:46 -0500 Received: from fsav404.sakura.ne.jp (fsav404.sakura.ne.jp [133.242.250.103]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 00F9IWri066843; Wed, 15 Jan 2020 18:18:32 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav404.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav404.sakura.ne.jp); Wed, 15 Jan 2020 18:18:32 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav404.sakura.ne.jp) Received: from [192.168.1.9] (softbank126040062084.bbtec.net [126.40.62.84]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 00F9ISbV066781 (version=TLSv1.2 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 15 Jan 2020 18:18:32 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Subject: Re: [patch] mm, oom: dump stack of victim when reaping failed To: Michal Hocko , David Rientjes Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <20200115084336.GW19428@dhcp22.suse.cz> From: Tetsuo Handa Message-ID: <9a7cbbf0-4283-f932-e422-84b4fb42a055@I-love.SAKURA.ne.jp> Date: Wed, 15 Jan 2020 18:18:25 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200115084336.GW19428@dhcp22.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/01/15 17:43, Michal Hocko wrote: > On Tue 14-01-20 15:20:04, David Rientjes wrote: >> When a process cannot be oom reaped, for whatever reason, currently the >> list of locks that are held is currently dumped to the kernel log. >> >> Much more interesting is the stack trace of the victim that cannot be >> reaped. If the stack trace is dumped, we have the ability to find >> related occurrences in the same kernel code and hopefully solve the >> issue that is making it wedged. >> >> Dump the stack trace when a process fails to be oom reaped. > > Yes, this is really helpful. tsk would be a thread group leader, but the thread which got stuck is not always a thread group leader. Maybe dump all threads in that thread group without PF_EXITING (or something) ? > >> Signed-off-by: David Rientjes > > Acked-by: Michal Hocko > > Thanks! > >> --- >> mm/oom_kill.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/mm/oom_kill.c b/mm/oom_kill.c >> --- a/mm/oom_kill.c >> +++ b/mm/oom_kill.c >> @@ -26,6 +26,7 @@ >> #include >> #include >> #include >> +#include >> #include >> #include >> #include >> @@ -620,6 +621,7 @@ static void oom_reap_task(struct task_struct *tsk) >> >> pr_info("oom_reaper: unable to reap pid:%d (%s)\n", >> task_pid_nr(tsk), tsk->comm); >> + sched_show_task(tsk); >> debug_show_all_locks(); >> >> done: >