Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3415600pxj; Mon, 24 May 2021 06:20:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZ/ZJ0502XJFHFhuDaEwgiXtRDTseMQDGREYknSnljNmObJQVYsDuH2iQuVixd6hHaYDTP X-Received: by 2002:a17:907:10c7:: with SMTP id rv7mr23187580ejb.125.1621862408989; Mon, 24 May 2021 06:20:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621862408; cv=none; d=google.com; s=arc-20160816; b=gj51Ei0mJEBqOSyw3QonCJblYrM6QN/WIjxTd+T+9+MT3/lp+lIQfyWhhdRu58bQlB NUZnw3oR1nefRcAOGGHnoyS27tEpVlOkMXls559ua8I4suMyOQB8dD5iWivQkycSlO8N JGcJ1YbJl4BhimbzfsCSU2iuKba5R9NQ43fI3RyBRc1Vi3FBnyvZ+zQs/houG2HyUG85 ujwx5tt0SnR46ltk1hdAGhX+Otf8yJVL45s48lb1gFiVXlDH4YYjaSBz2saa88wNmAN1 uE1CeVUI7HnvLjJeZxmdqqiqbPl8+8fp/C5qMNBiaLxBha+I4HxSPEDJR++XwYw0r77C /z5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=tYeENMZqICNqwNEdOZ74tQtw/Ef3oNWWuv3P25XAd+U=; b=Z/Ng/vZhBacpCN+GivnkgtSZU+xBs/wXCl9BVTre1B0mffDsT2oRI53AqSzxMmOK5B vSxUxCXH1MsqLVrNXGiLPqYZurXzHOWc2LfS84VPech2Xo/Sb8iojlxdx9liApZJhC4B SwO+XpuqfWyHIaj75Fr4R/etkcRKydElyvgp9k4jQ8u42YItfZF/d41x4xC2hIVYke6q ppxumhZRhgcAy9RjfDLs+IW94GrSmHAlpbGgRrqhphAeu4nnCmRIK+qxDYPuo9cZegQl cKP64qGui8G315z6/LNFuGvq34sfZrUS9zrcjm9MYMtOKFHcZ3r+09eo18UOuw27hm1N qd6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eIGrKvll; 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 g16si12739020ejb.301.2021.05.24.06.19.43; Mon, 24 May 2021 06:20:08 -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=eIGrKvll; 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 S232543AbhEXNTw (ORCPT + 99 others); Mon, 24 May 2021 09:19:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232401AbhEXNTt (ORCPT ); Mon, 24 May 2021 09:19:49 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 506B0C061574; Mon, 24 May 2021 06:18:20 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id w7so20171500lji.6; Mon, 24 May 2021 06:18:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tYeENMZqICNqwNEdOZ74tQtw/Ef3oNWWuv3P25XAd+U=; b=eIGrKvllk269Xsalcub08+tKQrLaQMeAD9UDifih7ZgmeRLps2KJ2P/AXnToTWWyEt mD1CzB9k0znR9KScbxl8/AnNn3Ska3pEysogZVGBoStwa6riVNktMI/FnofSPciOXObk o4lUHQlpNcY81p/uZANB0hSaC35WlCJbV5+XpoypMQWIYxOHAODxDHqDj54xaRyKQ/qe COi7+DXFb8cCrZkph9Gi6PxJIHiYbsQX6TdUk4n3v8UanedGfgSFn7I+pTt5R+Z20fqj iQ3AhhQ+OkPTNPvJVveqb97BXVaJocNkW5bZVIV9OwAU3wI//uzRPmgDt90ZTR+84k+W grDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=tYeENMZqICNqwNEdOZ74tQtw/Ef3oNWWuv3P25XAd+U=; b=MzIUmdXp9+gYMHuPk/iQB5pRH2tTjV7kfmQWL61OrfDT1UOKptZaDrB/fIs4DpHxau GRvh+6jxqiqHTzShWTt2KVOp9ewSldv6v+UMl52S9YAu7k6Q3aeEuZSdHII+EMJnBQJZ IqayW7OdvPXOKkpV26JdMGOb/RlJoXsds0U/dhQMoCsuYSNTHIhinY4l4PZZFag2NnnB x7MEQuUhwAXTJwcK//vtvZAwSbeaCuXUFbPUVeUv43V4yPlXJnebOm4oKpP1QzgBamFi Rvpmop4X40uVyMPDGP89b+K96eSk9cJMxYwPLwLsZoWXkxiiDpzAhSZSAsqw+7iWaZbt FhIA== X-Gm-Message-State: AOAM532EeqBvG2230Bqb8nG1Q1yDquKUDddeXEuFl2aetvur5FXOKw3o WguysIlQzxoxvHFBDGoOhxCjefT4vd5LgogGpFM= X-Received: by 2002:a2e:b4ed:: with SMTP id s13mr17008484ljm.86.1621862298712; Mon, 24 May 2021 06:18:18 -0700 (PDT) MIME-Version: 1.0 References: <1621578594-13237-1-git-send-email-sxwjean@me.com> In-Reply-To: From: Xiongwei Song Date: Mon, 24 May 2021 21:17:52 +0800 Message-ID: Subject: Re: [PATCH] docs: lockdep-design: correct the notation for writer To: Boqun Feng 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 24, 2021 at 6:33 PM Boqun Feng wrote: > > 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.. Thanks for the explanation. > > If you are interested, go ahead sending a patch fixing this, otherwise, > I will fix this. Ok. Let me fix. Thanks, Xiongwei > > Regards, > Boqun > > > Thanks, > > Xiongwei > > > > > > Cheers, > > > Longman > > >