Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3300216pxj; Mon, 24 May 2021 03:35:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCGvUb35urU6xj5aQ//EImgKEUC6+99WbiqgzICmwyc6TijP08wrEIkkBAESta0pQzLcK/ X-Received: by 2002:a92:c987:: with SMTP id y7mr17885762iln.173.1621852522436; Mon, 24 May 2021 03:35:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621852522; cv=none; d=google.com; s=arc-20160816; b=JHTziHXw/Rk0ivFNhVApikTFfi4zg6xmb3TNflvC4LuMJ+e44EGf3qzSVjNC5PySsY sFhO/2K1hRMwHE2J8tdXxQWx+S2j4fvPo2OrU+hjcnOKSBrDnMFAkOmu36vjzzO+NLTK CzNQTAgn6Yr/5fgqkziBFRr5wgHCejM1gqKPCjF5o3hVIvZBMOi4orAehayMAnB0cFEw qDlA35OszhSpyqTdzevLG3d4Nm8rH6a83UeLNOJdNJ2dSAcOJhmwlQrrFxQyMiFJebxj uXvVH9Eju47NhyOquYr9t0MhfupaywIYxsd8VnYDS/Sy3lyzTTiUTYZ4E7Ty77hP1u63 RQCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=nBhj/2ZkPLyc9vfqldjnaDjPl5196Tg+6nl0Q2SX0RY=; b=FHcfTSVgNaF3mioS6zOO85udtv2T6bmlYUED7qZlrEvEyO/iadflZlBA5NjFHId0of GNbllGihSZbkNe7Kj7hVvm6KOmcPrSFHe8mzb1cA66Do1FevtbFlrHmkrDeO9iI1/whP 2TPYF5c9bNZjVYKOg7Zyx0rZC4BMNc7rE9cXTqqq9QjJkisvKKCvUIOHZmicI7nkhExD N+jQviOFEGflpxFhYRK3DJgd1+ll9LU4A/5XpwnSnub7rKLg0/AqFzcRdeVDLyCJfqTZ jNa8oXN/wuziz5NFCgVgPFJaoO9X9mDx1IOltHmBsIj9v9D7Hfboi+NePLktCswCPior aOYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kSc65os7; 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 p17si13763691jas.72.2021.05.24.03.35.06; Mon, 24 May 2021 03:35:22 -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=kSc65os7; 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 S232476AbhEXKej (ORCPT + 99 others); Mon, 24 May 2021 06:34:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232397AbhEXKei (ORCPT ); Mon, 24 May 2021 06:34:38 -0400 Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59A0BC061574; Mon, 24 May 2021 03:33:09 -0700 (PDT) Received: by mail-io1-xd35.google.com with SMTP id a8so19202170ioa.12; Mon, 24 May 2021 03:33:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=nBhj/2ZkPLyc9vfqldjnaDjPl5196Tg+6nl0Q2SX0RY=; b=kSc65os7x9Zx5XJ3IQbSw/NUXAYvevZqSCEIfScyObou6NNoxwmWEfF5S7aEK5AGPQ hIh2mQ+K3mHbCb6+mGVbt82NoZStaaNZIbe3ApU6RkGdti07YCS4WwCrsaTS5nILzDiw spzY66m0FYxNqJY2fvM0spesTNgEaUOD3ypyuo1VvQh48XukukDnBZBa0TjZj6ZuLSrm SwJC8WiQ5oii8MzKLcWj8Il0lUMjtdCzfi1FuGsWAJwQh1nRSjN5RzyEp+8s03PYFelo ydcwvXeStjXT7THo7VLVFSFGNZNAps2nO7ZcRsUUcdAxlyfRGyPl2sduCYGI8Qx2noo/ +0Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=nBhj/2ZkPLyc9vfqldjnaDjPl5196Tg+6nl0Q2SX0RY=; b=d0H/e/y1hJ1QA7WYr4aHDFkLtWSZJNjKf6Ljz69FTvgfGpaeY+v70Md5Od8abZl6AC 8380CkPnJTRHXUe0Qa/amXUltk0gUkX6px5d6TRqtV5K3XGxGAYB9iruFgtyl5Q31KqG gTTHhJo30kAt2rJziZPysXk+rUqjlDJxGqZJg+znLg6wf6kLWAlIOtOnvyI9bHlikssF TMfZ+d2SilfPwMhdivxayvkFOclovvpocG8/xKc4B/IkOmHiPb34S3xCNRLrEszm99uO FHw3nM9lup8J5czAw98lylwoJt+dZ0h76nKkge1wRhYIFQrOdA3Jfxtb69jgyAaWIWIz 54uA== X-Gm-Message-State: AOAM530IKk0k6YtnLGTA+Ums7ZvPXHSwVZ88cLAz8Hz26FR5KpyIa22n /Ue5WKdzsaHtAI8ghmeGVqc= X-Received: by 2002:a6b:690c:: with SMTP id e12mr15202854ioc.69.1621852388720; Mon, 24 May 2021 03:33:08 -0700 (PDT) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id y202sm10751692iof.4.2021.05.24.03.33.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 May 2021 03:33:08 -0700 (PDT) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id 3927727C0054; Mon, 24 May 2021 06:33:06 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 24 May 2021 06:33:07 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdejledgfedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpeeuohhquhhn ucfhvghnghcuoegsohhquhhnrdhfvghnghesghhmrghilhdrtghomheqnecuggftrfgrth htvghrnhepvdelieegudfggeevjefhjeevueevieetjeeikedvgfejfeduheefhffggedv geejnecukfhppedufedurddutdejrddugeejrdduvdeinecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepsghoqhhunhdomhgvshhmthhprghuthhh phgvrhhsohhnrghlihhthidqieelvdeghedtieegqddujeejkeehheehvddqsghoqhhunh drfhgvnhhgpeepghhmrghilhdrtghomhesfhhigihmvgdrnhgrmhgv X-ME-Proxy: Received: from localhost (unknown [131.107.147.126]) by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 24 May 2021 06:33:05 -0400 (EDT) Date: Mon, 24 May 2021 18:32:30 +0800 From: Boqun Feng To: Xiongwei Song Cc: Waiman Long , Xiongwei Song , peterz@infradead.org, mingo@redhat.com, will@kernel.org, corbet@lwn.net, Linux Kernel Mailing List , linux-doc@vger.kernel.org Subject: Re: [PATCH] docs: lockdep-design: correct the notation for writer Message-ID: References: <1621578594-13237-1-git-send-email-sxwjean@me.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 24, 2021 at 12:24:00PM +0800, Xiongwei Song wrote: > On Fri, May 21, 2021 at 11:17 PM Waiman Long wrote: > > > > On 5/21/21 2:29 AM, Xiongwei Song wrote: > > > From: Xiongwei Song > > > > > > The block condition matrix is using 'E' as the writer noation here, so it > > > would be better to use 'E' as the reminder rather than 'W'. > > > > > > Signed-off-by: Xiongwei Song > > > --- > > > Documentation/locking/lockdep-design.rst | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/Documentation/locking/lockdep-design.rst b/Documentation/locking/lockdep-design.rst > > > index 9f3cfca..c3b923a 100644 > > > --- a/Documentation/locking/lockdep-design.rst > > > +++ b/Documentation/locking/lockdep-design.rst > > > @@ -462,7 +462,7 @@ Block condition matrix, Y means the row blocks the column, and N means otherwise > > > | R | Y | Y | N | > > > +---+---+---+---+ > > > > > > - (W: writers, r: non-recursive readers, R: recursive readers) > > > + (E: writers, r: non-recursive readers, R: recursive readers) > > > > > > > > > acquired recursively. Unlike non-recursive read locks, recursive read locks > > > > I would say it should be the other way around. Both W and E refer to the > > same type of lockers. W emphasizes writer aspect of it and E for > > exclusive. I think we should change the block condition matrix to use W > > instead of E. > > The doc uses 'E' to describe dependency egdes too. Should we change them > to 'W'? Personally, both 'W' and 'E' are fine. > I also think Waiman's suggestion is solid, there are two ways to classify locks: 1. W (Writers), R (Recursive Readers), r (Non-recursive Readers) 2. E (Exclusive locks), S (Shared locks), R (Recursive Readers), N (Non-recursive locks) And the relations between them are as follow: E = W R = R N = W \/ r S = R \/ r , where "\/" is the set union. The story is that I used the way #1 at first, and later on realized way #2 is better for BFS implementation, also for reasoning, so here came this leftover.. If you are interested, go ahead sending a patch fixing this, otherwise, I will fix this. Regards, Boqun > Thanks, > Xiongwei > > > > Cheers, > > Longman > >