Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1976107ybl; Thu, 29 Aug 2019 01:35:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/0xuzM6IuaP8ehWroRT6PlwlCycKjEawIJcEH/v8Yi1XH3skmcg30wCDGWOfLuwKX//Pt X-Received: by 2002:a17:902:e188:: with SMTP id cd8mr8551125plb.175.1567067709452; Thu, 29 Aug 2019 01:35:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567067709; cv=none; d=google.com; s=arc-20160816; b=ZISwAZepA4r6x3EybbUl08JT+WsTmMlVNd3eJ0KTWqIweKJ/l5QXphHD9X/qxUMQIy Uy/O/3fUg4fqYDxN4l6wkGoZ0SiBgvv5mi2//nqQMGa6MJQrianhwoW3yC+DqabbJKUR HBUvLrEtxMV9vow40kswgDJdlN+yggSsiyqzIDADG6/tnFNdR1skHc3v0zaq6QcWQ+Xp 5WfnTZyYmmFFDZ7p8pj+qNsJC7FidcMn3ZK8DeXLgeEgdyyBgBzEQlVuXOmTTjkSjbKC 11QyDSpKdPzBc98T4C2sY12RPzutryMCXPvOod5aY+rjEjdgUAfcVaQbdztwJy4qCVJi IjXw== 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=sZLyNbjwnYq3EhNtQGE8AtBJxMBei1zy6n7Azk1R3aA=; b=Ylth23dgOBZCOtcL+esIdqXVM3LyGaoGjBfPevGBck4/9jvbTO0I0IAAPC8B4/1UgH RBhsSkLrBPD2QIQndAnWd0guOfzGbKmh9nyG3vbNHzNAxVV2MNh0UM6YZF47c88ORjZX IXNGNveynm13tcId2ZD71sRw4YlnXMONI9n02T1gL6Wg3OKYOXpQo+emkNC1oe4bNnyj iSa442HrSTe9tLr71hkQ7LASk2vhvnRpkNoURkJ7hmNGjGufuWzgnO2NP+zZp02/L7Dk zvFDMeRh2KIwq3sKQ1VESF7EBjmi8VYWvzXO7cLpXtAcHaqE9m0UrVjpKUf6Bv7q4HUn gzXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mZkLAh2K; 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 a4si1526622pjo.83.2019.08.29.01.34.53; Thu, 29 Aug 2019 01:35:09 -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=mZkLAh2K; 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 S1727066AbfH2IdZ (ORCPT + 99 others); Thu, 29 Aug 2019 04:33:25 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:44977 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728036AbfH2IdX (ORCPT ); Thu, 29 Aug 2019 04:33:23 -0400 Received: by mail-pg1-f193.google.com with SMTP id i18so1196443pgl.11 for ; Thu, 29 Aug 2019 01:33:23 -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=sZLyNbjwnYq3EhNtQGE8AtBJxMBei1zy6n7Azk1R3aA=; b=mZkLAh2KWYrMI6XyZaHgsHZ0ICfjNRgDBN0M06N7cN0in+EMFQmMZTyk91YC2N9dsK jmB0hPO2laJTKXwZohaPlOsefKd9PPKtO8Jm+K54avQ0lLFEzR4Mi4DrFxnrWDJFDXml kZmupxcnoRN2uESJYX81wE95YMtiSsoRZ2hxl+gSisjTUE2zzXoZ319s2SPNFdkAK9Am ZgUGqkN48W9tRLoP8yZyDNgzBXFRQaVzgWKje6b5VnWWLNydauR55CiJsIjhSGDzos3/ KlWz0rUrK0afe1QPKQ1U3EdaCQWa4ziTGwY1W99stuC9yTpAoWfGxXpRVu3KHvqyXL3a naEA== 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=sZLyNbjwnYq3EhNtQGE8AtBJxMBei1zy6n7Azk1R3aA=; b=Hmw9AwZzhYEYDrvR8kfP8n1dh8OeLWhuQLsDGcYzf3L3oWbdqoY8/DjXYB1hQoxl+4 qpgDJG9hAHR1d3+prCJa9LBzM8/RKZYvW97Cp40yHxIAVhtw8wNNAXf00s3fTGnb4rD8 LuWEeW0HiUUYWmNY264QEebh9JtVeHnteD7ZvfrZsSBZFNVWbaUuvFrsTA9Zh+4b4rOn WNunFUCKkIAYZpKdkf+mt4ZdFmXQ1kbI1SKkjxts5XDLSaGgwK5eTtBAecRlKn8RUog6 oMLF7WhzcrKLVsXQR8xfqorDHfTI4tGgSg7xqhjcG2GVs/GhqaSXDjz71bW1pCCjhseY rxMg== X-Gm-Message-State: APjAAAW6aXv5q1GkmWmpfDrMxq5yxPqcZ9KJpv73dCkhEVBGzKNh0Srf YCI1dmHso/1OEXNZ7N4chR8= X-Received: by 2002:a62:6489:: with SMTP id y131mr9658230pfb.124.1567067603012; Thu, 29 Aug 2019 01:33:23 -0700 (PDT) Received: from localhost.localdomain ([203.100.54.194]) by smtp.gmail.com with ESMTPSA id v22sm1260155pgk.69.2019.08.29.01.33.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Aug 2019 01:33:22 -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, longman@redhat.com, paulmck@linux.vnet.ibm.com, boqun.feng@gmail.com, Yuyang Du Subject: [PATCH v4 25/30] locking/lockdep: Introduce mark_lock_unaccessed() Date: Thu, 29 Aug 2019 16:31:27 +0800 Message-Id: <20190829083132.22394-26-duyuyang@gmail.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20190829083132.22394-1-duyuyang@gmail.com> References: <20190829083132.22394-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 the 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 05c70be..4cd844e 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -1521,6 +1521,15 @@ static inline void mark_lock_accessed(struct lock_list *lock, lock->class[forward]->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 */ + fw_dep_class(lock)->dep_gen_id--; +} + static inline unsigned long lock_accessed(struct lock_list *lock, int forward) { unsigned long nr; -- 1.8.3.1