Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp808537imm; Fri, 13 Jul 2018 06:44:39 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcfscuRiMW5v3Xr3KNF61nSFMIYzIhQ+0fVdVlOlciDbqTwnhxRsH+k2rGXNYUZV+2fTYPc X-Received: by 2002:a17:902:205:: with SMTP id 5-v6mr6429253plc.301.1531489478951; Fri, 13 Jul 2018 06:44:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531489478; cv=none; d=google.com; s=arc-20160816; b=EFdQeHT7q3NYRDhTl8R4Od8s46GV9Vtw9RPpJpg47habfY+ggPQE2X2aEMeVcPhb4d 2pmcsotMLflbzyu97gUnzRNcsN9eewCQFKqcYGDUveSEOxzAmZ8wn7G1+SgR6UhDfLHB /nBkuu8t99rxrNaRfCBPpzU/9lOBJ0drSTXBqat7txqw5vDW+rg7PJB9g5Hcgf15XWvQ AAkmvzZjkm1npIpHOXbhOzwAxBhEoa14uQ7O5a0D4RTSaEtVM0Ofza6HP7VnSXIQAlay X6lWro86uwEmKi0ufmPQGUDbiH6IwqSip6HUHnyEkaI5WHAnh/eGpqOj1h2dQRn1feIw PrCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=N1TO7gWrDmdAFxyiSPuQ//UWXewWu0jJZYlbe8Z/X3w=; b=t5V6XOUFJoD6FbcIalZZq8weWHyQF7uhZ7QG8j5IyX6rmoRxcohG3NkT8i70hX+k0j 1QPu82xO5y6AX+qRKyi3kRw0PvR+q2LqPQUASGpPLTsC15rSdMXLu8zJJtDTTwGU4aO7 lush4BnFyYH+CW0Df57Cem2bpPT4vSQ7N6cn6sfZGJr8LslTzscitBPdMNxI50J4u3cc wuco2pNde1O7BlMlOZx/ZAGhV46SGFVfzp0e76xz379gTxjMo6U2jiTaFIwlGdOvROBK Nnoo7a0dKeo22HRjnKay8Uzodorp135bkTQnQtpTMSw+R37lmO0ggHwPX5aHbHMneU9h H3bw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d4-v6si24260699pla.81.2018.07.13.06.44.23; Fri, 13 Jul 2018 06:44:38 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729731AbeGMN5x (ORCPT + 99 others); Fri, 13 Jul 2018 09:57:53 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:55624 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729623AbeGMN5w (ORCPT ); Fri, 13 Jul 2018 09:57:52 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2E5287DAC8; Fri, 13 Jul 2018 13:43:09 +0000 (UTC) Received: from llong.com (dhcp-17-175.bos.redhat.com [10.18.17.175]) by smtp.corp.redhat.com (Postfix) with ESMTP id 50FC310FFE54; Fri, 13 Jul 2018 13:43:06 +0000 (UTC) From: Waiman Long To: Thomas Gleixner , Ingo Molnar Cc: linux-kernel@vger.kernel.org, Yang Shi , Arnd Bergmann , chuhu@redhat.com, Waiman Long Subject: [PATCH] debugobjects: Disable lockdep tracking of debugobjects internal locks Date: Fri, 13 Jul 2018 09:42:27 -0400 Message-Id: <1531489347-26826-1-git-send-email-longman@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 13 Jul 2018 13:43:09 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Fri, 13 Jul 2018 13:43:09 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'longman@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It was discovered that running the ltp openposix_testsuite sigqueue-09-1 test on a certain 8-sock IvyBridge system caused it to have a hard lockup with a full debug kernel. [89981.861500] NMI watchdog: Watchdog detected hard LOCKUP on cpu 17 : [89981.939812] irq event stamp: 1166122 [89981.943799] hardirqs last enabled at (1166121): [] kprobe_ftrace_handler+0x52/0x170 [89981.954215] hardirqs last disabled at (1166122): [] tasklist_write_lock_irq+0x15/0x50 : [89982.103134] [] lock_acquire+0x99/0x1e0 [89982.109163] [] ? debug_check_no_obj_freed+0xfb/0x270 [89982.116562] [] _raw_spin_lock_irqsave+0x5e/0xa0 [89982.123470] [] ? debug_check_no_obj_freed+0xfb/0x270 [89982.130851] [] debug_check_no_obj_freed+0xfb/0x270 [89982.138045] [] ? __sigqueue_free.part.11+0x33/0x40 [89982.145239] [] kmem_cache_free+0xca/0x390 [89982.151553] [] __sigqueue_free.part.11+0x33/0x40 [89982.158552] [] flush_sigqueue+0x50/0x60 [89982.164673] [] release_task+0x3e2/0x6d0 : IRQ was disabled by the tasklist_write_lock_irq() call in release_task(). The lockup is probably caused by the debug code running for too long. We certainly want the debug code to verify the correctness of the production code. However, there may not have too much value for one piece of the debug code to verify the correctness of another piece of debug code. In this particular case, the lockdep code is verifying the correctness of the raw debug bucket lock within the debugobjects code. The use of spin locks in the debugobjects code for synchronization is pretty standard and looks to be correct to me. So it is probably not worth the effort to verify lock usage within the debugobjects code. This patch disables the checking of the debugobjects internal locks by lockdep. In fact, with this change, the hard lockup was not observed anymore. Signed-off-by: Waiman Long --- lib/debugobjects.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/debugobjects.c b/lib/debugobjects.c index 994be48..592d2ba 100644 --- a/lib/debugobjects.c +++ b/lib/debugobjects.c @@ -1103,8 +1103,15 @@ void __init debug_objects_early_init(void) { int i; - for (i = 0; i < ODEBUG_HASH_SIZE; i++) + /* + * We don't need lockdep to verify correctness of debugobjects + * internal locks. + */ + lockdep_set_novalidate_class(&pool_lock); + for (i = 0; i < ODEBUG_HASH_SIZE; i++) { raw_spin_lock_init(&obj_hash[i].lock); + lockdep_set_novalidate_class(&obj_hash[i].lock); + } for (i = 0; i < ODEBUG_POOL_SIZE; i++) hlist_add_head(&obj_static_pool[i].node, &obj_pool); -- 1.8.3.1