From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756132AbcHXNpe (ORCPT ); Wed, 24 Aug 2016 09:45:34 -0400 Received: from terminus.zytor.com ([198.137.202.10]:49906 "EHLO mail.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753216AbcHXNpb (ORCPT ); Wed, 24 Aug 2016 09:45:31 -0400 Date: Wed, 24 Aug 2016 06:06:53 -0700 From: tip-bot for Vegard Nossum Message-ID: Cc: mingo@kernel.org, vegard.nossum@oracle.com, msb@chromium.org, torvalds@linux-foundation.org, tglx@linutronix.de, akpm@linux-foundation.org, hpa@zytor.com, peterz@infradead.org, paulmck@linux.vnet.ibm.com, linux-kernel@vger.kernel.org Reply-To: linux-kernel@vger.kernel.org, paulmck@linux.vnet.ibm.com, peterz@infradead.org, akpm@linux-foundation.org, hpa@zytor.com, tglx@linutronix.de, torvalds@linux-foundation.org, msb@chromium.org, vegard.nossum@oracle.com, mingo@kernel.org In-Reply-To: <1471538460-7505-1-git-send-email-vegard.nossum@oracle.com> References: <1471538460-7505-1-git-send-email-vegard.nossum@oracle.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] locking/hung_task: Show all locks Git-Commit-ID: b2d4c2edb2e4f89aaf85449dee3b87fbf0f8a4d4 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: b2d4c2edb2e4f89aaf85449dee3b87fbf0f8a4d4 Gitweb: http://git.kernel.org/tip/b2d4c2edb2e4f89aaf85449dee3b87fbf0f8a4d4 Author: Vegard Nossum AuthorDate: Thu, 18 Aug 2016 18:41:00 +0200 Committer: Ingo Molnar CommitDate: Wed, 24 Aug 2016 12:16:13 +0200 locking/hung_task: Show all locks When we get a hung task it can often be valuable to see _all_ the held locks on the system (in case we are being blocked on trying to acquire one), e.g. with this patch we can immediately see where the problem is below: INFO: task trinity-c3:14933 blocked for more than 120 seconds. Not tainted 4.8.0-rc1+ #135 "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. trinity-c3 D ffff88010c16fc88 0 14933 1 0x00080004 ffff88010c16fc88 000000003b9aca00 0000000000000000 0000000000000296 00000000776cdf88 ffff88011a520ae0 ffff88011a520b08 ffff88011a520198 ffffffff867d7f00 ffff88011942c080 ffff880116841580 ffff88010c168000 Call Trace: [] schedule+0x77/0x230 [] __lock_sock+0x129/0x250 [] ? __sk_destruct+0x450/0x450 [] ? wake_bit_function+0x2e0/0x2e0 [] lock_sock_nested+0xeb/0x120 [] irda_setsockopt+0x65/0xb40 [] SyS_setsockopt+0x139/0x230 [] ? SyS_recv+0x20/0x20 [] ? trace_event_raw_event_sys_enter+0xb90/0xb90 [] ? __this_cpu_preempt_check+0x13/0x20 [] ? __context_tracking_exit.part.3+0x30/0x1b0 [] ? SyS_recv+0x20/0x20 [] do_syscall_64+0x1b3/0x4b0 [] entry_SYSCALL64_slow_path+0x25/0x25 Showing all locks held in the system: 2 locks held by khungtaskd/563: #0: (rcu_read_lock){......}, at: [] watchdog+0x106/0x910 #1: (tasklist_lock){......}, at: [] debug_show_all_locks+0x74/0x360 1 lock held by trinity-c0/19280: #0: (sk_lock-AF_IRDA){......}, at: [] irda_accept+0x176/0x10f0 1 lock held by trinity-c0/12865: #0: (sk_lock-AF_IRDA){......}, at: [] irda_accept+0x176/0x10f0 Signed-off-by: Vegard Nossum Cc: Andrew Morton Cc: Linus Torvalds Cc: Mandeep Singh Baines Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1471538460-7505-1-git-send-email-vegard.nossum@oracle.com Signed-off-by: Ingo Molnar --- kernel/hung_task.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/hung_task.c b/kernel/hung_task.c index d234022..432c3d7 100644 --- a/kernel/hung_task.c +++ b/kernel/hung_task.c @@ -117,7 +117,7 @@ static void check_hung_task(struct task_struct *t, unsigned long timeout) pr_err("\"echo 0 > /proc/sys/kernel/hung_task_timeout_secs\"" " disables this message.\n"); sched_show_task(t); - debug_show_held_locks(t); + debug_show_all_locks(); touch_nmi_watchdog();