Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp317862yba; Thu, 16 May 2019 01:02:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpO/CY17Hk9uOs5M90sdR3kPXQSNWjbJSzvINPrst5i+qrNEvztAI2+vsuJB8jcvyOUebI X-Received: by 2002:a63:c50c:: with SMTP id f12mr48471223pgd.71.1557993754354; Thu, 16 May 2019 01:02:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557993754; cv=none; d=google.com; s=arc-20160816; b=PbS74ECuOfr8gnIKgbONAAkA2pCIXyGn6KhovR+v11WiUqChSFqsh5vvsPTiVpHl6B ctQ/6wrX0w6sau96OxaG3GeI4Brxvb4H4fkkg4XYB2Q1ugu/TPog/inX+jwUYv78J/y+ QqUJ9tcBkrXAY7IHjmnTaUgN9e7wMDq4AXbqFTsW01mZHUCTlQLkDQG0t3rSjDr0XqSz Htppj2hEJ6k6+rWw2F6EBuRONyWTZEOl8QP6qGw6F03rslOZVSdLPXfYib/llDeNbxWj bu0S+9km642kOIdXTQCzdw8BBVs2aozsCoRi3me6qbr6AP87bB8/DJbr8q+6kReJQOyx hiug== 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=YpW+vAT0Cpr2059Ga4zxgIqRrIamk2gVKxB/HsOolR8=; b=ByvmwLbNXh21h2LJLY3oPpBLxwQBIHojDkr5UrNIuzhvVr0DhioLsL1Iw/jXKz98lI 3JW9wV/sR/D3FKjfDAk9EB4uPhSs9BU22chYw4UOQRm3w/O05Mc0bpN9a/tSMf54D0V+ OWJObRVVtvDH71UljFd9WDjEOegnhsQfcFFAKSCtQaEd6KKHi9HjpeFxeT0oVE4uqJpa vdS0pI0nlxWPDrI+pLOzdneW0mBl+6S9P2MqjXyOItlYVxC7sMeJqBwl0JD3ogmIyC9d XSImiVgzdA9xwCXUU3sVdF9UqWTjzYWgh8EJ1hOMJdabgGh4lG8APaGP5jQUbY8LdgMb CE5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eJDQ2mox; 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 e3si4128016pgc.98.2019.05.16.01.02.19; Thu, 16 May 2019 01:02:34 -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=eJDQ2mox; 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 S1726941AbfEPIAv (ORCPT + 99 others); Thu, 16 May 2019 04:00:51 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:39410 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726899AbfEPIAt (ORCPT ); Thu, 16 May 2019 04:00:49 -0400 Received: by mail-pf1-f194.google.com with SMTP id z26so1418616pfg.6 for ; Thu, 16 May 2019 01:00:49 -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=YpW+vAT0Cpr2059Ga4zxgIqRrIamk2gVKxB/HsOolR8=; b=eJDQ2mox2qWgfQsPVTzBBwj7Pi7aonm1gHmIm4IwMOOFgOkYBPs9vNML+FMumchfoJ 2CcA4AxqgCXV+YQHsFCyoiI1QnBWG1XK1Vkyapk8V+UNWVW6bwy8wonvZKuSvknkPhOd U2JmLrIHVm9Yz7Wl+BDR0as7LR60++Ie17ag/rk3HjXd2HIwvkDCXU+ljfH1Mi5yY0K6 fgsLBLYE3AdyIyidTMUU2KbcmrmXC5edlPIs+pIPzyXXIsE5cjNaWabmKcLjghbVUldU RGU6BypmhLuok98tWjfrs1BwYfKA3ZgyNb9fRjDFsICAi6I0Mg8/klpxMpGOrUQwwymj yt/w== 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=YpW+vAT0Cpr2059Ga4zxgIqRrIamk2gVKxB/HsOolR8=; b=RBBIT+JsSUQSOHha65U1jkrOP+thMANXjkAeTmnlunQ4Qiu8FZ1rU3sgbLa3SB0qbC GU0eYhX+SllQGppCWzMNjGD+7E0GaPePnq0vb+3ivA9dL2Grwmx9IPahqfplHpEHTcgF Rp8F3K1sR6VYYJ5oIZGRjDMhcNxA1hclxpMquGgLk16ctWTyLJUxhry66jHeM1sj7teQ VQq6LkvePKR1wS0AXkVvp75dF0jo2CBI45AJiuKtFDVg/gIkS7Bo7snbpn7RLaZ67dsh nYohIXbirNYA26nbcYKkE17p+XWAi90BhOT91TPhAiamSr9v3rB5gQg1i/QNCAzZgrtf hLew== X-Gm-Message-State: APjAAAW9TMHpk3AVfNIri7fPtbw5Zszdt1PkktGFBJj8hShCI/pre4Pc XxOiP3u+r4aMnFgn1nyUKVs= X-Received: by 2002:a63:2bc8:: with SMTP id r191mr48213164pgr.72.1557993649175; Thu, 16 May 2019 01:00:49 -0700 (PDT) Received: from localhost.localdomain ([203.100.54.194]) by smtp.gmail.com with ESMTPSA id p7sm2051471pgb.92.2019.05.16.01.00.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 May 2019 01:00:48 -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, paulmck@linux.ibm.com, linux-kernel@vger.kernel.org, Yuyang Du Subject: [PATCH v2 07/17] locking/lockdep: Introduce mark_lock_unaccessed() Date: Thu, 16 May 2019 16:00:05 +0800 Message-Id: <20190516080015.16033-8-duyuyang@gmail.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20190516080015.16033-1-duyuyang@gmail.com> References: <20190516080015.16033-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 54ddf85..617c0f4 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