Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4141743ybi; Mon, 3 Jun 2019 06:23:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxPhnkeHqHLDfdP0wlBLRRnatSudYAGpDYIMDjQPxMqWUPLSso6yP33VEU0bjLlOpmuRh4Q X-Received: by 2002:a17:902:7592:: with SMTP id j18mr30999616pll.213.1559568217470; Mon, 03 Jun 2019 06:23:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559568217; cv=none; d=google.com; s=arc-20160816; b=XkAK34PPrwqzSbFkOlmeaEgAn7kaA0fBLKIzmJiwWoY8nmNi9NXgodTAOcNUD9/nDI ug2T7ABm8vZpCiUBtKiri2kECrFAzC5ml2lDsy+sShxjACcgEisSLfRVqcYJvJunl/ZQ LdV4tYwdiZkpUElP7JlTSoUnifVZ9XqW7ub4CBZIKRW1o82Onxt+wJYarmyGYyube/0o CdIgbkGkC+lLPe5Okd/ypoq5MeUCKjiYlFhNzUMnIAl6inX01w19AII3yIJcMqwNXZls rI5Vx5gZsJfa+9/SML7uuR0ICPrbPGo20Fc/ppzFnziHJGWfkXSyjLdbLUQSDevi5+qk swpA== 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=w+97sUoxh7aXFSaM+YX5AeARnMCTvJK9stemRThqBvo=; b=McXo6Hr7wCnp0r5F4nOJxTXB9y/c2wF1+ym2FEovR6p7SmnNYPGXcUT7QZDsu/vAxy L4vgWpIR5+ZkEU5lyIyNqNz3pcLzuZkXlWfHcAsKMaJD3ssk62QtL+aE+5iM0gPLo2ZY D5w9mLPt2bxQHaOwCXGl+QREzpYs+9/VgIQj9tauRBuhCrkTQCm4Yq9UucuLM3LrJlqN 2OvHPk1KksiJbbGgUb5Sdy1Ytn10cjrWg8e96twmWjBKi5o7rNXG2H1+nt0u05pF0nht 9Fck+AjNAj+cyAr3flVDyO/MaS/pJWBZOfZK372k3k3WT3GyFvof0FLadVnTbma5SXC9 8eSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019051801 header.b=lhaWEFoP; 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 i197si16344873pgd.80.2019.06.03.06.23.20; Mon, 03 Jun 2019 06:23:37 -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=lhaWEFoP; 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 S1728569AbfFCNU0 (ORCPT + 99 others); Mon, 3 Jun 2019 09:20:26 -0400 Received: from terminus.zytor.com ([198.137.202.136]:42291 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726360AbfFCNU0 (ORCPT ); Mon, 3 Jun 2019 09:20:26 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x53DKEnA606748 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 3 Jun 2019 06:20:15 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x53DKEnA606748 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019051801; t=1559568015; bh=w+97sUoxh7aXFSaM+YX5AeARnMCTvJK9stemRThqBvo=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=lhaWEFoPNh4OPdihfbJlkXIDCp5Zcwa1ZCVs6GcOpJ0LCgt+UJjUhwisUQVc7GD3v BoFxyIFKaN9zhcC62mavNdyAXsP92rHDh99I6OVfgxMiB6TIzOYTime/z344QtNSF+ DHasEl4rDW62oGYcddTVm9fFCGSM6JgnPSitP2O1YGgEquTLhYr75Nr2pK7GDuwJ0g 3eDLXf6Gtt9l4G12ZHfT+c6FRseyMvwrBF7DYV/nn1sH3c1/oFNygYhWLhcy2189Et vL2if/YFemiW4Y+4G9I+KF5UrCZedr+esfc8e2gpPO94uu7NznJqMMWS4FT/F5MRZT VpiXn2N0VXHjg== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x53DKEhP606745; Mon, 3 Jun 2019 06:20:14 -0700 Date: Mon, 3 Jun 2019 06:20:14 -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: hpa@zytor.com, torvalds@linux-foundation.org, peterz@infradead.org, duyuyang@gmail.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, mingo@kernel.org Reply-To: mingo@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, hpa@zytor.com, peterz@infradead.org, torvalds@linux-foundation.org, duyuyang@gmail.com In-Reply-To: <20190506081939.74287-21-duyuyang@gmail.com> References: <20190506081939.74287-21-duyuyang@gmail.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:locking/core] locking/lockdep: Check redundant dependency only when CONFIG_LOCKDEP_SMALL Git-Commit-ID: 68e9dc29f8f42c79d2a3755223ed910ce36b4ae2 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: 68e9dc29f8f42c79d2a3755223ed910ce36b4ae2 Gitweb: https://git.kernel.org/tip/68e9dc29f8f42c79d2a3755223ed910ce36b4ae2 Author: Yuyang Du AuthorDate: Mon, 6 May 2019 16:19:36 +0800 Committer: Ingo Molnar CommitDate: Mon, 3 Jun 2019 11:55:50 +0200 locking/lockdep: Check redundant dependency only when CONFIG_LOCKDEP_SMALL As Peter has put it all sound and complete for the cause, I simply quote: "It (check_redundant) was added for cross-release (which has since been reverted) which would generate a lot of redundant links (IIRC) but having it makes the reports more convoluted -- basically, if we had an A-B-C relation, then A-C will not be added to the graph because it is already covered. This then means any report will include B, even though a shorter cycle might have been possible." This would increase the number of direct dependencies. For a simple workload (make clean; reboot; make vmlinux -j8), the data looks like this: CONFIG_LOCKDEP_SMALL: direct dependencies: 6926 !CONFIG_LOCKDEP_SMALL: direct dependencies: 9052 (+30.7%) Suggested-by: Peter Zijlstra (Intel) 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-21-duyuyang@gmail.com Signed-off-by: Ingo Molnar --- kernel/locking/lockdep.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 30a1c0e32573..63b82921698d 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -1739,6 +1739,7 @@ check_noncircular(struct held_lock *src, struct held_lock *target, return ret; } +#ifdef CONFIG_LOCKDEP_SMALL /* * Check that the dependency graph starting at can lead to * or not. If it can, -> dependency is already @@ -1768,6 +1769,7 @@ check_redundant(struct held_lock *src, struct held_lock *target) return ret; } +#endif #ifdef CONFIG_TRACE_IRQFLAGS @@ -2428,12 +2430,14 @@ check_prev_add(struct task_struct *curr, struct held_lock *prev, } } +#ifdef CONFIG_LOCKDEP_SMALL /* * Is the -> link redundant? */ ret = check_redundant(prev, next); if (ret != 1) return ret; +#endif if (!trace->nr_entries && !save_trace(trace)) return 0;