Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3433698pxj; Mon, 24 May 2021 06:43:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy79xLgv3xr5JN4Lik+jMAZHt9tN6qUW3Q0s2N67Eb9Wb3saSCr069HKNUtgXrKXmHKkgui X-Received: by 2002:a5d:87c4:: with SMTP id q4mr13079674ios.141.1621863792534; Mon, 24 May 2021 06:43:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621863792; cv=none; d=google.com; s=arc-20160816; b=K9ZXZ1gen08Fo/3Js8yyiC91d13fkyLEFzw69GDuGBMxVV63LiXezCrC/CxEF+Js8Q KjCzxNhO4y5+UNjAPINAYabB4UMl61AeS8iScS2Ru9bwg5zQMRhWMlEix8lwM3OkoNtq lvYYCiWGX+TUUxFqbMwCuKhNqiZCoQscFkhZw0iLLeRgVAZFtsfY5HOFuxA4S+0VYlu0 5iIghbdCjjqShr8QgzKO/0ZRAIykLfdPesSf242Y8P27fq0uYHqw67IRKYjh/dFB9WtP OiaJMjtT34TX/Q1OQZcdh2rT/4eNFaRA39f7rb6gsOXPV4adF5EUiO9k9kCyByH/9Fnm mJWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:subject:from:dkim-signature; bh=LdCvQOrGWjsKZxZwOOVoEv2iDDtEdHzVz0K+vqaSd8c=; b=ZJecnLX2VP34PubxUdSDzo3I+nchg1ejVH+dQUZHb1/jDRhgURupo/g0zQSRYzh/c1 IqdoL8BAPezOoc1ifJiYDDPYmJE1iTBJBJAu4T2r6dwDXxtVEwPPQhH4sxVVxqBrqjZZ mgpYUMS2oL8jOnMpkkwr0lQkT2+J/IoH76FtTbtfxDBph9DoHRWOleRXN0GoQ+CjXsOw UTYlhZlDErn09dP0LxVsHA6ByUd205ErB8/MhP1+F5BABkpBi7+wDVDGCvIFM0Ys3H6e j2tsN1Ex9nxJrXc93jrEFyQB1IZoo+mQfyaO8bDIdZopaGl0Ezt3f9Uuj/XEkYCTCzoh ibsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OznwIRIC; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x99si14336133jah.122.2021.05.24.06.42.59; Mon, 24 May 2021 06:43:12 -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=@redhat.com header.s=mimecast20190719 header.b=OznwIRIC; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232409AbhEXNny (ORCPT + 99 others); Mon, 24 May 2021 09:43:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:38665 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232842AbhEXNnw (ORCPT ); Mon, 24 May 2021 09:43:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621863744; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LdCvQOrGWjsKZxZwOOVoEv2iDDtEdHzVz0K+vqaSd8c=; b=OznwIRICTH24zzW5gMa9gEsoTDyle4BU3ee+JgUiJIVKpl3pM09ZZ1uHJu02reUAlnptTI RhST/fPWO6X6PD4Kmxkaa6SWDmK7it39OPE8Aj6advPoDxpltxSciAtuf1cmHcYpDss7e8 2BWgPXtxgu0zFrCiDkdBJXS+kIf/WHA= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-393-NDW0gLubP4S_Mw1LOlBMFQ-1; Mon, 24 May 2021 09:42:23 -0400 X-MC-Unique: NDW0gLubP4S_Mw1LOlBMFQ-1 Received: by mail-qk1-f199.google.com with SMTP id n3-20020a378b030000b02903a624ca95adso9709983qkd.17 for ; Mon, 24 May 2021 06:42:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=LdCvQOrGWjsKZxZwOOVoEv2iDDtEdHzVz0K+vqaSd8c=; b=fOYBkS1ABNVu26sGmsQ21rzeo2URZVwBhgGmr1WyOSrY30U6U8uAUGptsFGJcBH20t OiqcOwf3aHdMJyX0SFZGuXiRoqZEZIrAU4q/ASZgsd/ATQ3gq1JN+qMFuR5QjMRteP6Y 3pZw/HfgZYVMveRrCxKsEKa3yhstVDY4Uu86P6n3Nl86XZhh3MBVTtwweCah/pPIVLlZ KLMBgD5ds31EtEcUMsdBRf+AsViJu79XLD2S+C5dgnZBID2OCiz1ctCEvqAkqqQnhqCn SgNp3BibbM7DrQDXH5a0nlFahrEZVUlvNIZc5prcPUeUORWWZefKT35PDbW2EAvGhc27 BCWQ== X-Gm-Message-State: AOAM530bKyqbTv3qShF3jVAAgUFAInxwDdA106o8d6t9RUI2jB9ui5ZL 8UkPCcdNJxymF2caPeB9vP8XkwxUyiuN5WBcZMsiAcAwX3mUEjVJ1NbaP2Yz2JRFKdP2c1S8EoS dmrIf+mFhcFL+QDzez5FFPdVr X-Received: by 2002:ac8:41cc:: with SMTP id o12mr26663196qtm.225.1621863742580; Mon, 24 May 2021 06:42:22 -0700 (PDT) X-Received: by 2002:ac8:41cc:: with SMTP id o12mr26663182qtm.225.1621863742394; Mon, 24 May 2021 06:42:22 -0700 (PDT) Received: from llong.remote.csb ([2601:191:8500:76c0::cdbc]) by smtp.gmail.com with ESMTPSA id c185sm10971448qkg.96.2021.05.24.06.42.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 May 2021 06:42:21 -0700 (PDT) From: Waiman Long X-Google-Original-From: Waiman Long Subject: Re: [PATCH] docs: lockdep-design: correct the notation for writer To: Boqun Feng , 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 References: <1621578594-13237-1-git-send-email-sxwjean@me.com> Message-ID: Date: Mon, 24 May 2021 09:42:20 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/24/21 6:32 AM, 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.. > My suggestion was based on the fact that it is harder to associate E with writer. So from a readability perspective, it is better to change the block condition matrix to use 'W' to make it more readable. Cheers, Longman