Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5798400ybl; Tue, 14 Jan 2020 15:21:12 -0800 (PST) X-Google-Smtp-Source: APXvYqz7rjcLKSL7yJGQhd0iAiEwHEx5b+Xmgt91yNyZXLfs6Quy9SnajYgyPmnGFr4G6zktsFrC X-Received: by 2002:a9d:7553:: with SMTP id b19mr667463otl.79.1579044072680; Tue, 14 Jan 2020 15:21:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579044072; cv=none; d=google.com; s=arc-20160816; b=Kln1LrWKgPTLIkFtgW6+lcMNzAwZarK2hFBg+vYAsXb+t9MsiSXLCCQUjXvhbtfh0K OEBTDQ563Aif4nC+qR+xSQGFxsKvX/qCzdjc8g7q1mIFvBulpS6fr5kkFPGDkQq3UfV8 gcq1+teuGmu6JWLANhhum+qIzuldfvJ3QigHqhQNE0LcE9lDvKQfeRSlgR2gOVmFvay1 KhCnLFBSVIkFi2L5cTA5lwb//UrdQNUShqYMj6Am2fSP6uBv4mHoLqFus3T+UFkVRbW9 NMI2esNToiv7iQx8sAMhi6pWgnYfVFu905lGqk0rvE44uwdGEzSCtaggzLxwjAazMoGO tIag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :subject:cc:to:from:date:dkim-signature; bh=+W/hJ8TzLATqZod3a/d6aLW1agOHCtatzoP3Zrx0ONs=; b=fTbB+lnJZtWjik77k7Ute+2ToBwVfiW3gQ7lmu+djZYNzI2hQCABSjbmlHJthEjawe 75pUoJ4asvU7Wwim9MgkgFL6TSRY6fZNvX9UaiL4A08PXgJqVh2glTEBxIrUWiQnujaV 893H2yZltZsNEFYw2qAZ2cj1BzbV9p69S5cJuRgV8JF7Oe9BxziYUgM3UJorcKwtcYAf iObWLAps/NM3gafS9Gbn1yy3w7k/my2XGO8fIqn1HkZlm4gycjE0S1ZFlu88POFhzzNC lyJZtJL4p+DS319oA1RBbNRCU3fnaAUD6YyW/ux3mKVIhZn2xoD8h3bg7wy/bIHt4I9g lzIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=WEdiWoAH; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j70si8805128oib.219.2020.01.14.15.21.00; Tue, 14 Jan 2020 15:21:12 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=WEdiWoAH; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728769AbgANXUH (ORCPT + 99 others); Tue, 14 Jan 2020 18:20:07 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:44458 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728650AbgANXUG (ORCPT ); Tue, 14 Jan 2020 18:20:06 -0500 Received: by mail-pl1-f193.google.com with SMTP id az3so5864050plb.11 for ; Tue, 14 Jan 2020 15:20:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:user-agent:mime-version; bh=+W/hJ8TzLATqZod3a/d6aLW1agOHCtatzoP3Zrx0ONs=; b=WEdiWoAHhSS5cith0JJnt9gzqlaQmn9e6YCl3KEIpAvdf9hH89FF7BxVO+fzRtd/0o 7oiqJOUhS7lUkABkKtJ8Om4bI+38bBqx61xZr2hjaqmzQWKG0whBMAmJpZ5xa2Prk9ic 09Tq4nNbswotDFH8GPs3GXll83WQK9hhnH4RnvfJ/MGwdRj5awsIOpTCy9yCLCPEqJQl SaMcgdAS62trXxEpN7dO/INmboHDOusiKbUDXNDT6hgHvNJiCEU8o6YuJpIqJ3nm3FE6 +b99HXXPQbGDrWKDOcXFTBXfyCgQ/iJyk8ejmL3oukf0xsZW7LjFBnVurUHuYxBJJGp2 Xs/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:user-agent :mime-version; bh=+W/hJ8TzLATqZod3a/d6aLW1agOHCtatzoP3Zrx0ONs=; b=rzLveAxnmlvMFKPXpn2cNXcQnhbYxo/LJoZecbx/KXMfel/GqahbgVfjYlxMmWFfI1 4LALcO+Vfk9I8g/wU/EgSsfWIl6w6xWnjvYc1sMH8RqpjuzX2Ssk1gQorW6ijMGxvX/b FZoR/lKDySWw9sN+YL8PObpGCY4GHedOtu3nW56M495hGvF7Tog0Fg8acUwtIIXCbI5V G1eanETjLSPlORirIip1YbAVj3tuLQPpQYpKbQIT1MjjVJDj8WeCQKgZQsL2Aribid7e 9e6/2pVJzLpXzaYWVQa6cPEDKMgODF2mgB2bW+0skXe3oUYOSDbGUcVWzWzU0tPs6l6r MNYw== X-Gm-Message-State: APjAAAVpOjQt1i7eyx5nJt5eW13IkAazO2oabqXFHzo2ran5yapXrNax w7QiuIIWkPCKjw/NmF/N2KOwirblay4= X-Received: by 2002:a17:902:b611:: with SMTP id b17mr12491949pls.23.1579044006207; Tue, 14 Jan 2020 15:20:06 -0800 (PST) Received: from [2620:15c:17:3:3a5:23a7:5e32:4598] ([2620:15c:17:3:3a5:23a7:5e32:4598]) by smtp.gmail.com with ESMTPSA id d22sm18150830pgg.52.2020.01.14.15.20.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2020 15:20:05 -0800 (PST) Date: Tue, 14 Jan 2020 15:20:04 -0800 (PST) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Andrew Morton cc: Michal Hocko , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [patch] mm, oom: dump stack of victim when reaping failed Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: David Rientjes --- 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: