From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751116AbeAVWBA (ORCPT ); Mon, 22 Jan 2018 17:01:00 -0500 Received: from mail-qt0-f194.google.com ([209.85.216.194]:39323 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750953AbeAVWA7 (ORCPT ); Mon, 22 Jan 2018 17:00:59 -0500 X-Google-Smtp-Source: AH8x227jUtMiU8TV0p8RHWcGocGRedbVcAASAFnspMOuh481ApsDa+ikAZc8IEIVjj7DTRQwtQxwcw== Date: Mon, 22 Jan 2018 14:00:55 -0800 From: Tejun Heo To: Peter Zijlstra , Ingo Molnar Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: [PATCH] lockdep: Avoid triggering hardlockup from debug_show_all_locks() Message-ID: <20180122220055.GB1771050@devbig577.frc2.facebook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org debug_show_all_locks() iterates all tasks and print held locks whole holding tasklist_lock. This can take a while on a slow console device and may end up triggering NMI hardlockup detector if someone else ends up waiting for tasklist_lock. Touch the NMI watchdog while printing the held locks to avoid spuriously triggering the hardlockup detector. Signed-off-by: Tejun Heo --- kernel/locking/lockdep.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 5fa1324..5216590 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -49,6 +49,7 @@ #include #include #include +#include #include @@ -4490,6 +4491,7 @@ void debug_show_all_locks(void) if (!unlock) if (read_trylock(&tasklist_lock)) unlock = 1; + touch_nmi_watchdog(); } while_each_thread(g, p); pr_warn("\n");