Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4425710ybi; Mon, 3 Jun 2019 10:38:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqzKS0i0qgkH508dhH2BqfpQCRioAd4H8ibVFkbJATREbp0VQ2fzgq5lgOyRqHPK+Q1zyc1B X-Received: by 2002:a17:902:e30e:: with SMTP id cg14mr9651741plb.47.1559583480577; Mon, 03 Jun 2019 10:38:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559583480; cv=none; d=google.com; s=arc-20160816; b=rOMW/BY2pY6EoT0WHRmEEib9E5wOYFM63LC9uTsyNMtX4gXMPy54rCNY06CUbbUxEK hWFsV+EZ6RW6N1uDToj3pYHO0KRHSuKk0eFD36rDwGuLwntCn0pE3qTcBAgGbrf/pcaL VGBA2YmDpgocmmtmaI7svwjSuwKHRjV/j+OSW2/aaB8mUCkqylQBXE6ybjtThCXmeQh0 Nkw/DuZEnK8UEpfR5UVYYbpy5PmIjZPx/MtzMOhgRW2rnBKWFBIBWwEj3XrZVUdPJeAh 10Z5MXsJNDCDlIEnjU+j7+DRVB2gGWAE1DmqZ+0nRDK9xus+SNASWC8sDdLDxEown1Fb /dwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=dJ+qfyn8VxxHFwwJtefaqDx8ffionAHA+SuDYprmkt8=; b=jewCrAftFTytGa1nASeepNG+2IYZCnyNvxhJaUqOzSMk5KWeui2PdK3EmUrQ+YobBZ c40NWPxdOnsPr9nse9XSKvjZVgKB5Vg+IBaybzVjre1W/ck3cpgpIi+//dRuaLS7uNxr sX5T7F0FycHqeS0Alw+x+iMHJ+hNjkRXVs9sPTBkoGNm8baW8YhYH/PkWVat6PGWlTZ+ qf1PNSTjGViZMXcSPDlunkVR6XLy/LRni1pK77UHjOsvZ6HYeO9r963h08/fhhOj75c9 RKfFqR58pCbpgH0Y4x3VKUr+F6PJ35FejimcfIznPNQAHpCgp6Pk6X6V4WBScQDmO65J ay2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019051801 header.b=qbNP7mx5; 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=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f1si19493409pgi.432.2019.06.03.10.37.43; Mon, 03 Jun 2019 10:38:00 -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; dkim=pass header.i=@zytor.com header.s=2019051801 header.b=qbNP7mx5; 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=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728385AbfFCNJ3 (ORCPT + 99 others); Mon, 3 Jun 2019 09:09:29 -0400 Received: from terminus.zytor.com ([198.137.202.136]:39145 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727641AbfFCNJ3 (ORCPT ); Mon, 3 Jun 2019 09:09:29 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x53D9HSo605082 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 3 Jun 2019 06:09:17 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x53D9HSo605082 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019051801; t=1559567358; bh=dJ+qfyn8VxxHFwwJtefaqDx8ffionAHA+SuDYprmkt8=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=qbNP7mx5JR2gBIFzLp1NP7vABJOaHtRWeesYiltjRp6AH3LkdvSXEMZLEoekk4j7q Z5hOGzUHNwcOdH36JPnn9cUZGEG8HQDzBrQB7WRhFnXsCu7dQI9Zr0rcitUabeKNzv Tux1z4a0a0w0OIHialwCQaaSe20/DrvkO/Hmcr1uqD/BD5arXRwGlPgpNKu/BjXKXl 5MsfSVXv7WfAtOEH3o/NAn4+AA6qcrTHRCmcYyuLHasuRuuuVJkIkHnxJGk0+Zx7vE jL/XO8LXGhkVhzFm2sEv/H2fVDT/CfiJJaVHrbC80jeHTZ9hde4OB4osHS/VPG6aiw EoQXpU8YzK8vQ== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x53D9HcZ605079; Mon, 3 Jun 2019 06:09:17 -0700 Date: Mon, 3 Jun 2019 06:09:17 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Yuyang Du Message-ID: Cc: peterz@infradead.org, torvalds@linux-foundation.org, mingo@kernel.org, tglx@linutronix.de, hpa@zytor.com, duyuyang@gmail.com, linux-kernel@vger.kernel.org Reply-To: hpa@zytor.com, linux-kernel@vger.kernel.org, duyuyang@gmail.com, peterz@infradead.org, tglx@linutronix.de, torvalds@linux-foundation.org, mingo@kernel.org In-Reply-To: <20190506081939.74287-6-duyuyang@gmail.com> References: <20190506081939.74287-6-duyuyang@gmail.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] locking/lockdep: Print the right depth for chain key collision Git-Commit-ID: 834494b28024b39d45aea6bcc642b0fe94fe2503 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 X-Spam-Status: No, score=-0.3 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_96_Q,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, FREEMAIL_FORGED_REPLYTO autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 834494b28024b39d45aea6bcc642b0fe94fe2503 Gitweb: https://git.kernel.org/tip/834494b28024b39d45aea6bcc642b0fe94fe2503 Author: Yuyang Du AuthorDate: Mon, 6 May 2019 16:19:21 +0800 Committer: Ingo Molnar CommitDate: Mon, 3 Jun 2019 11:55:36 +0200 locking/lockdep: Print the right depth for chain key collision Since chains are separated by IRQ context, so when printing a chain the depth should be consistent with it. Signed-off-by: Yuyang Du Signed-off-by: Peter Zijlstra (Intel) Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: bvanassche@acm.org Cc: frederic@kernel.org Cc: ming.lei@redhat.com Cc: will.deacon@arm.com Link: https://lkml.kernel.org/r/20190506081939.74287-6-duyuyang@gmail.com Signed-off-by: Ingo Molnar --- kernel/locking/lockdep.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 3c477018e184..bc1efc12a8c5 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -2519,10 +2519,11 @@ print_chain_keys_held_locks(struct task_struct *curr, struct held_lock *hlock_ne struct held_lock *hlock; u64 chain_key = 0; int depth = curr->lockdep_depth; - int i; + int i = get_first_held_lock(curr, hlock_next); - printk("depth: %u\n", depth + 1); - for (i = get_first_held_lock(curr, hlock_next); i < depth; i++) { + printk("depth: %u (irq_context %u)\n", depth - i + 1, + hlock_next->irq_context); + for (; i < depth; i++) { hlock = curr->held_locks + i; chain_key = print_chain_key_iteration(hlock->class_idx, chain_key);