Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp402784img; Tue, 26 Feb 2019 02:04:36 -0800 (PST) X-Google-Smtp-Source: AHgI3IZKpq+Ea3Ne2yf7a/AWP3/KncBh1E1pluiKcYZVFXf5yPsRNC38oDbdhSMs/Nkl8SQ+kmBM X-Received: by 2002:a17:902:f095:: with SMTP id go21mr24746463plb.199.1551175475954; Tue, 26 Feb 2019 02:04:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551175475; cv=none; d=google.com; s=arc-20160816; b=q+bn2iMM9SMB7MUaNCWAosDNsUWw2fY1xvF8yK+EZrKLqdKbaIV4anlfg7Ls4OuihB U6108jjqSy1LGVF9LvOH0dVcnKeE4JbTftfU9kfFp0Z2Yup1dW04IzaXpFIVzzW0X9bC r+OpU23MOgwMpnPAyWspjMHGe4f801awxUu/X3yeAfpJySCxdPKMPckyduBOxchQrVOm z74QSheemJgRbOSYahRuvR7WTVa6HAEoqrvE8OwZS5mCU7Q06/BAd+UwL42qJLq8nNLS xcFn9eFBxNLzgca67tuvpeS9R/ZZEFoemq8VG0x4sesFApRqPQjxP9fpo442Yt4RaH0L 6+SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=70NA6I+KaNwoJWkboM2n35K+1R5PJ0p/4kTJUUd+ebg=; b=OJ6A3dJnvVgvwLaMKwyRvE53eCVHL7ga8Q+1jmt8m4x1sgEvrg0dsbY2hdGmEXTz3x CChLoquPWHMEtmk8aFMyjdTtyZqf7AUjPJFRgRxgaIf1HM+hZCN65f+waH7+Hvd8JRwo vz+fec1jDn7qJ98glsbZi/KVwobwIPXr7yh293W8ZD4Wg86/xU1tR9zxwQ0R0NFpG1y7 tLUkDSQFjALxPqu+i07JRlqlILipIwI83iJ/W/Llgu8ENEzTmRoWpMDC7s8LeHc+ifGw U6pC1eyMzghsnUThDy3A3doOr2yzI8z3lwUl3yGW7pO/fs6zJJRwNA5MTMkqCW63/nTi x+0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=m91qCFRe; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g4si12636107plm.184.2019.02.26.02.04.21; Tue, 26 Feb 2019 02:04:35 -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=@gmail.com header.s=20161025 header.b=m91qCFRe; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728128AbfBZKDw (ORCPT + 99 others); Tue, 26 Feb 2019 05:03:52 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:34761 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728086AbfBZKDv (ORCPT ); Tue, 26 Feb 2019 05:03:51 -0500 Received: by mail-pl1-f195.google.com with SMTP id d15so6020556plr.1 for ; Tue, 26 Feb 2019 02:03:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=70NA6I+KaNwoJWkboM2n35K+1R5PJ0p/4kTJUUd+ebg=; b=m91qCFReD0ELM0HYpIcHLKo1wuhKavEVtvl1WQ3vI7s7JONhAHxGfQIsTGB/f4sfhn IVplvtFJv8b/KqxDZHh0tUbjhLGrM05fOWUvXiQI1dc+3AT5fOn2PGtqN49xvNEKxdD+ q7nodTYHEU7LrJcmMGvc7KZB3hKyvBs7XqRHDR2EfqBoKcvrqexwWIeq20mjlbHEzNZe qoek8h4mJc0b/f6impX7PY6h6SH1n7APi03c8XkE6N5YS45SvLtlnyL/XGKZH1BgBqfv h/vaRwZ1BD7FMB86ZQkD6CJlIz43fSsWXICi6QAAY5sIz73PutHoP778QL0z/XeF+Gny 91lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=70NA6I+KaNwoJWkboM2n35K+1R5PJ0p/4kTJUUd+ebg=; b=GI5RFn1W2WwQZu8zYwBdL/gksRQZnBE5NaFqF47iZM0yFAdIUn3xYi14y8Pa1qPvet tOJ+mKxZ1Ck7c9yh66fIsrSmiHqRXRr4BrVD2IGTcj3e+5SmkLpqmCIjRBCj7F4qlFTL PWOBxsvZKKCYoQQnQbkUYIwrivzAUtlhSsTPx42SGRAoALw6bwDK+Is2um4JvrHQw7th J6jyAkcvojowmw4oMRKjyblOfWzTN3Rk5GCyi8PsM0BX3E8Jynrfl+d2Ku5YVHtWpdxm W+cltTgB97f4RZSWfYNmV4KlJvhrtAU21sPtBUCiMShnlhMlG8DbnzMHl0qA+0k1LWJZ HzWA== X-Gm-Message-State: AHQUAuZqlqYLiXT7Iirbuo3VPDN843ZAgBrpHWh4ZmoPE/PMuZb715wv hEuvrcVWuC/KtTla9QkIQpU= X-Received: by 2002:a17:902:bd96:: with SMTP id q22mr25406895pls.7.1551175430930; Tue, 26 Feb 2019 02:03:50 -0800 (PST) Received: from localhost.localdomain ([203.100.54.194]) by smtp.gmail.com with ESMTPSA id y6sm12045520pfy.87.2019.02.26.02.03.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Feb 2019 02:03:50 -0800 (PST) From: Yuyang Du To: peterz@infradead.org, mingo@kernel.org Cc: linux-kernel@vger.kernel.org, Yuyang Du Subject: [PATCH 6/8] locking/lockdep: Print right depth for chain key colission Date: Tue, 26 Feb 2019 18:03:25 +0800 Message-Id: <20190226100327.19340-7-duyuyang@gmail.com> X-Mailer: git-send-email 2.17.2 (Apple Git-113) In-Reply-To: <20190226100327.19340-1-duyuyang@gmail.com> References: <20190226100327.19340-1-duyuyang@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since chains are separated by irq context, so when printing a chain the depth should be consistent with it. Signed-off-by: Yuyang Du --- 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 55270938..ec4f0c6 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -2061,10 +2061,11 @@ static u64 print_chain_key_iteration(int class_idx, u64 chain_key) 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; i < depth; i++) { hlock = curr->held_locks + i; chain_key = print_chain_key_iteration(hlock->class_idx, chain_key); -- 1.8.3.1