Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1974808ybl; Thu, 29 Aug 2019 01:33:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqyhB1TlUl0JTQOX3srMf3O/BksTsKkHVBpIxNTIv4JgO4tPBdY7+QHvk9KjUOdTryDqfIr8 X-Received: by 2002:a17:902:76c2:: with SMTP id j2mr4327129plt.305.1567067613833; Thu, 29 Aug 2019 01:33:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567067613; cv=none; d=google.com; s=arc-20160816; b=EgH9lKWk9yEL40q6jx9cZ2A1S90ck60ZM7BymXfd3NNy1uWo3hz4neGUUIv+X3CAxQ 947OrVK9mS7nnjLSw1aO9YQYR3iuNEVHWfY9v5qmnEOi+wRdeTwl8cJLUzrl9eOWTJya vfbzZ3SrZ+cdNQb7v8xsjxYYoViudQiJwJkFpKvFxACnLW83xrTeWUv6YjC0zww8IApV DZZawPYm9KZ2kEmsrGysQ8tXTraLiZq01WRRqQdPPrxxMOogRTsDzEPeL973/2UM8IDh mGo0GW81XUHTpubO69ii9DUgN1KM5a1jumFnoiu56NxETB+z3K8LZ95bExu0R5fuelXJ so8w== 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=beN/1HqGmBYk8ed7VYMK+GnR0j/QGkzSjGXWJHlh76c=; b=bywFbYtVnQY2+KNAt82/tlEQ1Kwaloc9ALP9HxaemYAiQov/cgQQ0pdNK8+NfBtMjr rgAw307WZOzzBJQO791Bmv9W6EWQGSebEgJV46RTKlodfBepKC6OXFIJHetKr+ODDjfj 8dJNABrnxcrJFzbXntK0N3t2+XZdrWeDxucmnhn7A9Bse31GkMsqc/3x8QQxQ4GDrblR nN3d+qE+ryarQiW8PQb2EmihaY1UgDD5938zi9TNXpoLAkQrBRAWBwaGoA35hYKmhVDP ADYTGnxjFs1OmCZmkD0mDzOEMf9+viq2jmwb1FHA0pZA+V7hCUiUBuA0STw1MzLNJwSS /WZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vWBplqGZ; 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 f29si1947849pfq.100.2019.08.29.01.33.18; Thu, 29 Aug 2019 01:33:33 -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=vWBplqGZ; 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 S1727175AbfH2IcK (ORCPT + 99 others); Thu, 29 Aug 2019 04:32:10 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:33243 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725776AbfH2IcK (ORCPT ); Thu, 29 Aug 2019 04:32:10 -0400 Received: by mail-pf1-f193.google.com with SMTP id g2so1591380pfq.0 for ; Thu, 29 Aug 2019 01:32:10 -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=beN/1HqGmBYk8ed7VYMK+GnR0j/QGkzSjGXWJHlh76c=; b=vWBplqGZihCL4YgrsF7BRUaW+ALkNr4bx2tO/MwAfxS8/5oj65KdFoXrqmBL0O0Zy3 o1GLm17WhLujRAS1j52P499GqiJuArJC++hVZ56MU1V5SLQZG4GSUBhc/44Fv/CJj3Xg Ux+Vy7Ifn8aQSj+Fj2cxUYZdos6bgy+fo+gqgHDuK+oqv2mo6BgsU9Dl4lWLQoNTsU7L +K7XvAR0q6wf2Mdp+cFYHzuC8RwJ9p+C2W6FpKqhBcvDu/NBmpxS/pNPTBFToIgB0D+V UQzc3RGVrRtCwXRfeRj9FSgZN6b+wFuaf6J1IyODG/nFA/GYFYOvDBxxwcovzO6UDQm8 jx9g== 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=beN/1HqGmBYk8ed7VYMK+GnR0j/QGkzSjGXWJHlh76c=; b=huAzwgHbBVhvtcQxBTfuijfGh2S/LbP5NQw2u82udNkg3R62b4PqwbBZqYado+NMZ2 BHrWmp7ZTYsgwvqPgVH6RhT9zQPbOmpFw2FYy526Le0ltNVt7iJcZ7I8fc39KUgAyHGC PSw+XMUzHiCvTny5KRZGBRWpf35Aj8ywqcVUQIuIo0Yo4HrSbBYNq1xUK58zuIh5Kpji YNOhJOViWMA8o3MHB+D+bhwvwKYetF7EFOWvcl/d1ye4H8DhDSFyQ66v4bRWVLvRHpyl Z6+VpMbhStfMyQZE1neJiGeXhTrSLFsFxdK3RcPdrQqbO5EcKhSJjw1oRdiOBs2da5dA c6YQ== X-Gm-Message-State: APjAAAWpZ6sgZQmZSlZ5TfJlRn0fXrZoRnarGtdpdhpyL+VQwRgH1WaE hlVHXZdVcZNtAxD4yH2WcI8= X-Received: by 2002:a17:90a:c70e:: with SMTP id o14mr8638948pjt.56.1567067529746; Thu, 29 Aug 2019 01:32:09 -0700 (PDT) Received: from localhost.localdomain ([203.100.54.194]) by smtp.gmail.com with ESMTPSA id v22sm1260155pgk.69.2019.08.29.01.32.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Aug 2019 01:32:09 -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 06/30] locking/lockdep: Update comments in struct lock_list and held_lock Date: Thu, 29 Aug 2019 16:31:08 +0800 Message-Id: <20190829083132.22394-7-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 The comments regarding initial chain key and BFS are outdated, so update them. Signed-off-by: Yuyang Du --- include/linux/lockdep.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index d7bec61..0246a70 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h @@ -195,8 +195,7 @@ struct lock_list { int distance; /* - * The parent field is used to implement breadth-first search, and the - * bit 0 is reused to indicate if the lock has been accessed in BFS. + * The parent field is used to implement breadth-first search. */ struct lock_list *parent; }; @@ -239,7 +238,7 @@ struct held_lock { * as likely as possible - hence the 64-bit width. * * The task struct holds the current hash value (initialized - * with zero), here we store the previous hash value: + * with INITIAL_CHAIN_KEY), here we store the previous hash value: */ u64 prev_chain_key; unsigned long acquire_ip; @@ -258,12 +257,12 @@ struct held_lock { /* * The lock-stack is unified in that the lock chains of interrupt * contexts nest ontop of process context chains, but we 'separate' - * the hashes by starting with 0 if we cross into an interrupt - * context, and we also keep do not add cross-context lock - * dependencies - the lock usage graph walking covers that area - * anyway, and we'd just unnecessarily increase the number of - * dependencies otherwise. [Note: hardirq and softirq contexts - * are separated from each other too.] + * the hashes by starting with a new chain if we cross into an + * interrupt context, and we also keep not adding cross-context + * lock dependencies - the lock usage graph walking covers that + * area anyway, and we'd just unnecessarily increase the number + * of dependencies otherwise. [Note: hardirq and softirq + * contexts are separated from each other too.] * * The following field is used to detect when we cross into an * interrupt context: -- 1.8.3.1