Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3894539pxt; Tue, 10 Aug 2021 14:06:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPG9JPBbxbzdvvZd4Pog+IKh4C7hKr/nSvknWcwmX4wPfYsdeQIgKV8U27QoRxRoPAtw53 X-Received: by 2002:a05:6402:202:: with SMTP id t2mr7265338edv.116.1628629559825; Tue, 10 Aug 2021 14:05:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628629559; cv=none; d=google.com; s=arc-20160816; b=M7qCswz7D3bzl0Rl8gigR2HIXET6KKFomAVNNqD7rUMHDEPvBpCI2qJU43+NKMPGV0 zmSpbUpqCNjNF6RDmsW6pBABpswYWhsjy6LFqzoDqfYqRwP9cgL1D/66EFe/DljW4wOR FRg/8L1YnXtxT7bdY5NEEVJSndekQx8KgYxnNUfJxcNwyDgc6gwx8OfzFgw7e5IWxzTH XvFX2U5ex1DFXlBLkrbrUUwrljhyBaYdJtoztZ0UkhQicauLcXrNfFwzTmp3Q3Xem7/U eNpRnfExGnAXRNvrehUASDOr+/nmJ08pSZSOrkZWvpmP4LZLUS2Ngjh7cutmyf0ggfRP hX5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Fz0iEsmbP+UovNHnMjy0vvTC6LaoMPc9ZqWQw5ZZu2U=; b=KmzeusVg8UQW74bxVz8ZBzNj0b3d8WIoefeSNcRckpbMYzExdU0XjZxp8zVU2hkoXm G5/f0s91odVKn2nIssEjGddhzNju0Us9SpQmptrN1C2sabrTOUA6YmqbLpmpSgSajJZk u7rQ4Egg7YP10lYi0wW/Zk5hUrk78Py5/qX1b2TtkryURqzM7yoEWiPxfTXBNgcLxgRg 3oUaZCxl8c+FR8zP29oax44CHSE0K9HyHdr2AX2KbBQnr++IDqLVFaVg2csY3GKWW9kW LX4J6BKH1eCMZC1+nAlFOVn6Ms/7zaEpjYpIYbd7UWbOJs+syXq/UOALRlWEtqqsrGLG NgGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=doBa1shV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id ee47si333654edb.149.2021.08.10.14.05.36; Tue, 10 Aug 2021 14:05:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=doBa1shV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S233224AbhHJVEE (ORCPT + 99 others); Tue, 10 Aug 2021 17:04:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231894AbhHJVED (ORCPT ); Tue, 10 Aug 2021 17:04:03 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F41E0C0613C1; Tue, 10 Aug 2021 14:03:40 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id nt11so6478pjb.2; Tue, 10 Aug 2021 14:03: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:mime-version :content-transfer-encoding; bh=Fz0iEsmbP+UovNHnMjy0vvTC6LaoMPc9ZqWQw5ZZu2U=; b=doBa1shVFvbzNc/vedDkWmubrx/3avl+zKtIt42eDsdkVr/HBmO1nJtjzO9kIPDaSO y5cfp6It+ZLCVLU0Bb1ouUzSggifKkB81Ag7IQWfk2/1igiTJ+6GPvSpMHeZFpgLRQGT y13ETRZ3DYVSSr7f/0miwSx2uQ9FxmdzV06GspPmw9Bx44kS0ty9ZIyUtVU0RO0+1x4r DQ5pqZsS3f8keEjcY8P7vHh6DoqLjOGdBPKVIMiNb3WkZ3AZ/nmohbUydXFNIkQF40+i WEPVsxT5iTAs4m32S+0OOGjEN1g7Q8pz+Jk2R2KHBjrBG4v0G/0NzHKFA52lah8h/6uz pqPQ== 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:mime-version :content-transfer-encoding; bh=Fz0iEsmbP+UovNHnMjy0vvTC6LaoMPc9ZqWQw5ZZu2U=; b=fWPOL73Gvbm+h/2h8jSA/IrMzC6qbcr536yOQeVpJwY+ADkjR1XNJZn/XvQ4NGIENm WDCQ6YZZdpWvSw7Sc4K8P3kkmES+L3HPUiqz21c8b5KCnwBGrK7WlsHTat4447nkjxg0 fNAsYgegP/CVIYgEBkx+D2uBsMYpt/46/Xx3Swtb+IFrVJTKaigpW51EkIVBG4NkVD9a 7/+OwvGRAUgFxuGsz554zRu+bKcnChC1eyd0ZCHp3Vc3mStFk0LnEgotVG3gCtajgsbp ymlmBPOz1N13lFQ19oFr+hVekm3zrjNp/3YBEiw7/DEj2FnzC4QmpuiAlEtSjKmFyA/j oA9Q== X-Gm-Message-State: AOAM531x5TeAso9UggrMQMFkytG6V032ckj0NeMprAqjIU88bIqTevAC vqZi6buq2KYr6Sxg1/ip9gk= X-Received: by 2002:a17:90a:5a4c:: with SMTP id m12mr7097453pji.15.1628629420520; Tue, 10 Aug 2021 14:03:40 -0700 (PDT) Received: from localhost.localdomain ([154.16.166.173]) by smtp.gmail.com with ESMTPSA id a4sm1868333pfk.0.2021.08.10.14.03.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Aug 2021 14:03:39 -0700 (PDT) From: Zhouyi Zhou To: peterz@infradead.org, mingo@redhat.com, will@kernel.org, longman@redhat.com, boqun.feng@gmail.com, paulmck@kernel.org, josh@joshtriplett.org, rostedt@goodmis.org, mathieu.desnoyers@efficios.com, jiangshanlai@gmail.com, joel@joelfernandes.org, linux-kernel@vger.kernel.org, rcu@vger.kernel.org Cc: Zhouyi Zhou Subject: [PATCH][RFC] lockdep: improve comments in wait-type checks Date: Wed, 11 Aug 2021 05:03:19 +0800 Message-Id: <20210810210319.6564-1-zhouzhouyi@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter, I think comments in wait-type checks may benifit from some comments improvement. I recklessly add Paul to signed-off-by, because I asked his opinion about comment in rcu_read_lock_bh part. Thanks a lot Zhouyi Signed-off-by: Zhouyi Zhou Signed-off-by: Paul E. McKenney --- include/linux/lockdep_types.h | 2 +- kernel/locking/lockdep.c | 2 +- kernel/rcu/update.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/lockdep_types.h b/include/linux/lockdep_types.h index 3e726ace5c62..d22430840b53 100644 --- a/include/linux/lockdep_types.h +++ b/include/linux/lockdep_types.h @@ -21,7 +21,7 @@ enum lockdep_wait_type { LD_WAIT_SPIN, /* spin loops, raw_spinlock_t etc.. */ #ifdef CONFIG_PROVE_RAW_LOCK_NESTING - LD_WAIT_CONFIG, /* CONFIG_PREEMPT_LOCK, spinlock_t etc.. */ + LD_WAIT_CONFIG, /* preemptible in PREEMPT_RT, spinlock_t etc.. */ #else LD_WAIT_CONFIG = LD_WAIT_SPIN, #endif diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index bf1c00c881e4..952d0ccf8776 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c @@ -4671,7 +4671,7 @@ print_lock_invalid_wait_context(struct task_struct *curr, /* * Verify the wait_type context. * - * This check validates we takes locks in the right wait-type order; that is it + * This check validates we take locks in the right wait-type order; that is it * ensures that we do not take mutexes inside spinlocks and do not attempt to * acquire spinlocks inside raw_spinlocks and the sort. * diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c index c21b38cc25e9..690b0cec7459 100644 --- a/kernel/rcu/update.c +++ b/kernel/rcu/update.c @@ -247,7 +247,7 @@ struct lockdep_map rcu_lock_map = { .name = "rcu_read_lock", .key = &rcu_lock_key, .wait_type_outer = LD_WAIT_FREE, - .wait_type_inner = LD_WAIT_CONFIG, /* XXX PREEMPT_RCU ? */ + .wait_type_inner = LD_WAIT_CONFIG, /* PREEMPT_RT implies PREEMPT_RCU */ }; EXPORT_SYMBOL_GPL(rcu_lock_map); @@ -256,7 +256,7 @@ struct lockdep_map rcu_bh_lock_map = { .name = "rcu_read_lock_bh", .key = &rcu_bh_lock_key, .wait_type_outer = LD_WAIT_FREE, - .wait_type_inner = LD_WAIT_CONFIG, /* PREEMPT_LOCK also makes BH preemptible */ + .wait_type_inner = LD_WAIT_CONFIG, /* PREEMPT_RT makes BH preemptible. */ }; EXPORT_SYMBOL_GPL(rcu_bh_lock_map); -- 2.25.1