Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4933625yba; Mon, 13 May 2019 02:18:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+/m1NU2WngVT/NuPh95mGUW6Py2107ElylgKqAlah1JJagBW3kE0jQjNA8LhJVd5BgEv5 X-Received: by 2002:a17:902:aa91:: with SMTP id d17mr28244854plr.251.1557739086491; Mon, 13 May 2019 02:18:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557739086; cv=none; d=google.com; s=arc-20160816; b=PNKbr7WkrRfIaZ6+9IW7Pe6zho42aQkJ8q2VKhAEMMgWBAIpwCAm6WrUN8iwnAhZj8 lX5rsc6YMO1F5i93m0ZHipwkwe8b0UxJNYx2ZbJf383d1TdYS/3KLOgsXWxIC8nEAaYr 13eOTQStQQQYuFPvQkrtrJcP4IdmkqtF0QhptkdAUPSIaAvWlHlWd0TXASvx//ZjI6M9 JeOw6BUdF/TDaRM0KmBXUCHYgSGJYfqJm5uUIs5Y/EI7c9hbUzCiE3oUTMtJOqd+bcD+ 0+k79efk7kNVL79CbmYBgKUhwoqfxj1nFekPDvbCnH9ShJ3ZpWZXfwR5J2o7JcrH154/ ESOQ== 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=SdiRF7cmY2+TjzGTcChzgzJlbCutxASQzMbp0ZC+13I=; b=INwaTwdQXEouA8VC8YpdwUqXrqoYqQFUyewzH602w7BnTG5tDA8rQXLx3F/XtGYsvv sRBksmJzTPAm8wdsASdN14yUFcYlO8jJsUGnR6HPH02+rF1T4jhM5uWvJ7+1zqUMaTnd ztDmu83rwx+STAhUWNTIC7+gyWeidhmXH5OWTVcV6ueyKzJBLBxNO1iKeLAYk+KgNJ1S sUjnoZfxHyAPMOluLppYGbXafgPeDP8MvYQl/XH0uFMGCitP1keVIvY2nO3TGXL9c/rx 51z2lKiYjC+M3kzmk2CyjKkwH+D2iCC3qS3m3UjilTRRsYErr+EozAW1JHdtCSYpjuyB UFTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eavWDj0t; 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 t34si7190546pgm.396.2019.05.13.02.17.50; Mon, 13 May 2019 02:18:06 -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=eavWDj0t; 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 S1728690AbfEMJNm (ORCPT + 99 others); Mon, 13 May 2019 05:13:42 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:34226 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728669AbfEMJNk (ORCPT ); Mon, 13 May 2019 05:13:40 -0400 Received: by mail-pg1-f193.google.com with SMTP id c13so6465893pgt.1 for ; Mon, 13 May 2019 02:13:40 -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=SdiRF7cmY2+TjzGTcChzgzJlbCutxASQzMbp0ZC+13I=; b=eavWDj0tkUpwBOJomcDBEsvxr77LpmthAm3l0tEiRxVYetXL3d7CuGVCqPzsujS7eg C75jZS83QZwYtmtJMrMRTcmlbyLULKuJ+iehtf8Pp4weDgssbxm67c+3dcc32L1tNt/+ C2VYQxAFmCAzIueiGAOsdpxz1GII8McQRY8dm5XTUwHhV1uWSt50NAg0IjomIC3S9WmG 6iNvA1XvHhHvwS+H9v7KfDY3zRVe1BEvQBgQBp+WS2R3a0NxiKNy4Ec+XJx6DpWeybfS LuAthLCx/pZBvN9Lrhs/wB1//ujwrLBlic5JPpcixe7iz3M/pdWXQEEVaBYjClMDUDPQ 3izw== 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=SdiRF7cmY2+TjzGTcChzgzJlbCutxASQzMbp0ZC+13I=; b=aFgNRLC20drlCjk7sfzjBpATO6PMAcy645RSfE7elKqp5sWVbjb7Dz4ioQslAG1aqs qZRZl7QFBcU5ORHTtCGUD6EQtqG3Mid9LrBaYj7rOtIRuhv3rO7udUzwUYNcbsEma6FF 5l1wySNfctAGO+6AHFUUJkCchAi2Xi6o4xG+ZhxGZZse+NLlIWh60Tf2s/QtW6dvVCGK UIb81QKq7PeprB75+ghdLweMUbqHU6OeeCytwUgcmfM/11DqHeKQKJTb6bSk70um4A2U WwmHaILmzkZ65RJCElGnz6WM8AbCPZwen1LvBJX66Mst+pb5uI0bMFeFxR//vym4X164 2TMQ== X-Gm-Message-State: APjAAAUSa0HlWobL+RseynyVLYo+nK/e7vlZ4dvs/BhJs/xNVefpFJBo 7Gwu7NcNCmMSy6qmflY4Wa0= X-Received: by 2002:a65:44c8:: with SMTP id g8mr29987962pgs.443.1557738820456; Mon, 13 May 2019 02:13:40 -0700 (PDT) Received: from localhost.localdomain ([203.100.54.194]) by smtp.gmail.com with ESMTPSA id n18sm35500837pfi.48.2019.05.13.02.13.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 May 2019 02:13:40 -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, boqun.feng@gmail.com, linux-kernel@vger.kernel.org, Yuyang Du Subject: [PATCH 07/17] locking/lockdep: Introduce mark_lock_unaccessed() Date: Mon, 13 May 2019 17:11:53 +0800 Message-Id: <20190513091203.7299-8-duyuyang@gmail.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20190513091203.7299-1-duyuyang@gmail.com> References: <20190513091203.7299-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 Since in graph search, multiple matches may be needed, a matched lock needs to rejoin the search for another match, thereby introduce mark_lock_unaccessed(). Signed-off-by: Yuyang Du --- kernel/locking/lockdep.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 4d96bdd..a2d5148 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -1338,6 +1338,15 @@ static inline void mark_lock_accessed(struct lock_list *lock, lock->class->dep_gen_id = lockdep_dependency_gen_id; } +static inline void mark_lock_unaccessed(struct lock_list *lock) +{ + unsigned long nr; + + nr = lock - list_entries; + WARN_ON(nr >= ARRAY_SIZE(list_entries)); /* Out-of-bounds, input fail */ + lock->class->dep_gen_id--; +} + static inline unsigned long lock_accessed(struct lock_list *lock) { unsigned long nr; -- 1.8.3.1