Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2201856yba; Mon, 6 May 2019 01:22:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqwtCJtSIgIUZlRaakkn08DLGZLynsE8re+I7jMYVFoPiVZ5f+esSkGVQmZqdEQoPYitCMcY X-Received: by 2002:a63:5c1c:: with SMTP id q28mr13078689pgb.45.1557130965696; Mon, 06 May 2019 01:22:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557130965; cv=none; d=google.com; s=arc-20160816; b=cOXxhtpifiGBgFWDJkTmooIMnFXxRpCf7PX1cFy1MBHOa/hoUHxmlQn+2mASphTFkq bidQyZiXolwdKLfQfK7g+KDJI7gjvnx/bw0oN2jw5x2tDRSzP+jts7WKNsQMgLcEqfMr 4ir/5JORSMToZfx+DSm5zAWh/jOG/+N8F78lf/1hJ/IkdZtofBCxb6OjBvXDek6bXhA2 AC53j0lBfGxw2Db6kMm6UpSoviCFhmd9aWmwjL5AFGhRFlnWQjD7CY/qNbDoflOh7ck4 WYpue1OF1AKz9EpxXGXWnm/XYJzRD0oq/IohKYy58jJHluhGatPLrHZHCs3E5K23cyLV ncaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=r6Ul8DqLCrwUzW/73FoDcrnG9o+ApspVb0NBeqVAdd8=; b=bkmjakKecTYyx2eLXZqHerERyO//tZHDXs+lfV8JmWd/v9eNr5jh9NTy85WKimA7nu fOsHAPRLU38ATtQtP7ItKD/fIS8SicWNyiN2ZVTMQCwLte9NeoVCAr1Js9dWsWv+XnkG pwbhi4YdqAHPpODBX86YfhsM8ELlidZlvRcejfLW70Mzz5skPPS1H7pKYW3LEg7Tm0gG fcr1Tfz1iKthmHYhlUktMUsKUEZlBYKMet1Ktc7EyFLOM22qcG2Dyu2sch+PSImAPSG7 4RX0Xz5+a8oVEvgTs1GStohpi1Y+2ync+uySeTx/HfEiMLb3Nglj2MOBgp+TMKTGuHSf NI2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hvsUWLx4; 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 71si14791905plc.160.2019.05.06.01.22.30; Mon, 06 May 2019 01:22:45 -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=@gmail.com header.s=20161025 header.b=hvsUWLx4; 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 S1726723AbfEFIU4 (ORCPT + 99 others); Mon, 6 May 2019 04:20:56 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:38814 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726648AbfEFIUx (ORCPT ); Mon, 6 May 2019 04:20:53 -0400 Received: by mail-pf1-f195.google.com with SMTP id 10so6355802pfo.5 for ; Mon, 06 May 2019 01:20:53 -0700 (PDT) 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 :mime-version:content-transfer-encoding; bh=r6Ul8DqLCrwUzW/73FoDcrnG9o+ApspVb0NBeqVAdd8=; b=hvsUWLx42A+WRy5nb3rtkdmvbL88ClAOBumICvHHENL9aBosAJJvsojy2mJkQgLe/i PJOM51rfzWErur+UtjhVQgkwvI4fvVvtX328WwrFda5xsP/rPA14X7UlH8tmJTEKV5IC FVvynx1zFzjcq4u80+/T/Ed40SjJFKCZMnk1rvcosqj8TRSYJMpunekTAP9c3XKPQRIx 3PJGz1dklrRr4fq5NrS3W3dvvCsskEEG5EQvPvuikNN4JLXpkHPwak5BBYuToi2BeJ82 yAJTJH7uQeSmeuZFBu1TBNXOcDLETwCA+IoMrdMkwnjfhF4mzfUFJapMcvOoGK7s37rz N5cw== 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:mime-version:content-transfer-encoding; bh=r6Ul8DqLCrwUzW/73FoDcrnG9o+ApspVb0NBeqVAdd8=; b=ViDJhTs8KSuHwoDDwQXimcu0Z8fC0ovZZOd4quAcqnoD/62X6hwLzjQhNyaApma/sf P3iuh9Moo2PR+F4lz/M51qWQwzcm66LaTDPaW4444bEJQGwptyYBra2y9iAKQAU0NSxl 6Mip++InC7UCuUXSrSelp3+Qfx53MjcLzrOXDiR2ZFHfjZ2FKpcsxGqVEZWCS8bZU3HO 9vF/mNweoSimU2E9+MLFhR7OFmp1MOU0Qa3BGDlAs/h3gplsiQGutiKyNcWq/mssoXlk pMp4bMZwgZK8FVbpDrG+7lk0j50zX0ftBQMswbHGtuJWYn4Mch0dLypz5TSKC0xTNNO8 cPNg== X-Gm-Message-State: APjAAAX2aVE2hQ74JGHuQhIkxSVvgkJ5qZNnhsNobOBkUHssV/lm6Hiz q1k7k5BcTn72oOpq3J0r28Q= X-Received: by 2002:a62:4c5:: with SMTP id 188mr32120914pfe.29.1557130852698; Mon, 06 May 2019 01:20:52 -0700 (PDT) Received: from localhost.localdomain ([203.100.54.194]) by smtp.gmail.com with ESMTPSA id v19sm20958013pfa.138.2019.05.06.01.20.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 May 2019 01:20:52 -0700 (PDT) From: Yuyang Du To: peterz@infradead.org, will.deacon@arm.com, mingo@kernel.org Cc: bvanassche@acm.org, ming.lei@redhat.com, frederic@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org, Yuyang Du Subject: [PATCH v2 20/23] locking/lockdep: Check redundant dependency only when CONFIG_LOCKDEP_SMALL Date: Mon, 6 May 2019 16:19:36 +0800 Message-Id: <20190506081939.74287-21-duyuyang@gmail.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20190506081939.74287-1-duyuyang@gmail.com> References: <20190506081939.74287-1-duyuyang@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- kernel/locking/lockdep.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 2502ea4..9d2728c 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -1734,6 +1734,7 @@ unsigned long lockdep_count_backward_deps(struct lock_class *class) return ret; } +#ifdef CONFIG_LOCKDEP_SMALL /* * Check that the dependency graph starting at can lead to * or not. If it can, -> dependency is already @@ -1763,6 +1764,7 @@ unsigned long lockdep_count_backward_deps(struct lock_class *class) return ret; } +#endif #ifdef CONFIG_TRACE_IRQFLAGS @@ -2423,12 +2425,14 @@ static inline void inc_chains(void) } } +#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; -- 1.8.3.1