Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2624515lqo; Mon, 20 May 2024 11:05:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXf6240Wzzr8tsR++Sxwmfx89pVvuAYUkZ1V53SAp9qMbZniVuZjKdZlZRnt2T24fmc8oblkQVyZ2/Sov/wXl3dOg0QBrCAmAOaJ3PJ6Q== X-Google-Smtp-Source: AGHT+IGypypYD4FzwqTpKtStXPPhlltdiE8aXdqC4Y391Fa0c+BiwZeezexVCWIZ5aRHGOpFmHMt X-Received: by 2002:a05:6512:48c5:b0:523:8b4b:8c99 with SMTP id 2adb3069b0e04-5238b4b8ccfmr14077278e87.37.1716228341917; Mon, 20 May 2024 11:05:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716228341; cv=pass; d=google.com; s=arc-20160816; b=Oh3Z4808nOLMXd9FPmz/T42b0687fKkNE7OGP6Po0TfI5QyF7/0kf7nMjSSd+c0SX6 8BAq6khtmyXxVFJEOvSbHuNSL9+4xUBqz420x7NbC0XNGt1nWqkIcfUeGrNf/xScmeuH /Y0Ybbl686Zl9EHC/GswIXg5NRd9Zaz+bicLe6IHpp7lJr5V54XkVRpZvGlR84bEZ04e HPry0ncq+NqrF2KDOOVwxB+g3FAOuNiiP/kC0QgYFTP2/dHg/hxORqvJDp78q0Mcn+eA NyZAOTyJJdlF2JeD1waQ+mPz2YXNI1caj6HMrWGKc55yr7tZxgyi0Gp5ScsAuuxdNJrF BKoA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=5Xd24fdv9N6NKwzCbLRlWwHk94MJ2CAnavOpN05B3t4=; fh=geeHGWzaZWX1ulQSwzfD/QqY6q7T1geIMMpKSDUZUzQ=; b=z9wpULGzTdLheDnEznBOkevkHxCC7tloX8YzJgc9H7SWjRgBBTz7zDIfEHzlqNFJIU QNmfElVsBD5eT45JWRjRVD3wF2rOn+tSM9sEaTQILkgju+VsF+rD8a2/aSJdOiOCNevZ 2r2TPEsN+JeflNDtoYlfkGjfR30yZLwcoAjoZ3Ho3Tu73+aQBya6l3bYGPQAfS2GlnEo /+je45rMLD117CYUs31syf1lQP8alHeD5Q4PxRJvM5OwmFdAW3dnQ4Y7pl2dSqiIdDVH hrdTW4xe+BtKXymAswZqtjrjfZEZ/cyQAhsgVjmjjKaMJAJK8BBkhOOkZxkX3X+m0ykt /IDg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tDnSfZn9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-184048-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184048-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c2d5e58si13884394a12.314.2024.05.20.11.05.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 11:05:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-184048-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tDnSfZn9; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-184048-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-184048-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 9148A1F225A1 for ; Mon, 20 May 2024 18:05:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 987A9137C3E; Mon, 20 May 2024 18:05:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tDnSfZn9" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B7C4A34CDE; Mon, 20 May 2024 18:05:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716228332; cv=none; b=mIJ//TCFRfpt/Llr38CVwipUOWy5fq9vMLc5BefbH1PHWfNDn/7j3KuMGdKQHp3ypArrC+CzCpJ1ZFllVpPaHil+DRE+K71OUoDER9EXLeij0pTkimvD2j7y8EirfAZDncEhj04aOymOhRq2pwfsvgGhXi4ZvO7qhXxBk0RmohU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716228332; c=relaxed/simple; bh=fe0UcvX4RKyP+54gpQ64qZRY1cISErxtCFj+FyCrqVI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=g7DicqGJSnGYwV1rTE5YVnXKomnOToSijEg8urYpzNW3MFtI8APIpwFVxGmgFV+x5AxYdvb94Q+OHYcdwQw/5JeF2ZHlRQPzR+B7B0dIzvn4ZLWfocTEHcxhkyIZ2Dp1KBlBAqa09+82JuWGXb5uD1J7Mxc+/CH1qxOdKPz0F3g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tDnSfZn9; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4E39CC2BD10; Mon, 20 May 2024 18:05:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716228332; bh=fe0UcvX4RKyP+54gpQ64qZRY1cISErxtCFj+FyCrqVI=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=tDnSfZn9+DolgC7qHMN7wdeEtzOqkgm1iuWyrvbwsBvH504JRpoeSIo+vcrSGLEFP 3AaGTl2kjDBQdfszqrGVp9DxG4fUCp5ivs54FeOZ9fCoMTOgnGkhQj3qwq0FmoErQY duP5ZS3JxGW1X/UzybA8+VswOAV98w5oJ6mxwLOGnY09pn9r5iR9DWMwTMm5yKJ7it ENxht2fwRbFM98LBRPI8CeD7tnyfrlNu2z54wTy43qMqjD0AACt16kDXGqEK4ixjc4 cJzHX7mU1xtHn7UaAaXNwrz5QuM7vyIfM9bqKW7OzO3IfrDLOKKMqJTFdaIbq/KapC idGAeS01yhWZg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id EAE9DCE0C3C; Mon, 20 May 2024 11:05:31 -0700 (PDT) Date: Mon, 20 May 2024 11:05:31 -0700 From: "Paul E. McKenney" To: Marco Elver Cc: Bart Van Assche , Breno Leitao , Jens Axboe , "open list:BLOCK LAYER" , open list Subject: Re: [PATCH] block: Annotate a racy read in blk_do_io_stat() Message-ID: <14bb1b20-b03c-45c1-9566-9287eee23c54@paulmck-laptop> Reply-To: paulmck@kernel.org References: <447ad732-3ff8-40bf-bd82-f7be66899cee@paulmck-laptop> <59ec96c2-52ce-4da1-92c3-9fe38053cd3d@paulmck-laptop> <75421237-4c5a-48bc-849e-87a216ee9d32@paulmck-laptop> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, May 16, 2024 at 08:35:02AM +0200, Marco Elver wrote: > On Wed, 15 May 2024 at 23:51, Paul E. McKenney wrote: > [...] > > > And I just checked the current access-marking.txt to see where we > > > might add more, and found the section "ACCESS-DOCUMENTATION OPTIONS" > > > already exists. I think that section is perfectly reasonable as is, > > > and it does explicitly talk about ASSERT_EXCLUSIVE* macros. > > > > > > Did you want to add it more prominently at the top? If so, maybe a > > > brief forward-reference to that section might be helpful. > > > > How about like this? > > > > ------------------------------------------------------------------------ > > > > The Linux kernel provides the following access-marking options: > > > > 1. Plain C-language accesses (unmarked), for example, "a = b;" > > > > 2. Data-race marking, for example, "data_race(a = b);" > > > > 3. READ_ONCE(), for example, "a = READ_ONCE(b);" > > The various forms of atomic_read() also fit in here. > > > > 4. WRITE_ONCE(), for example, "WRITE_ONCE(a, b);" > > The various forms of atomic_set() also fit in here. > > > > 5. __data_racy, for example "int __data_racy a;" > > > > 6. KCSAN's negative-marking assertions, ASSERT_EXCLUSIVE_ACCESS() > > and ASSERT_EXCLUSIVE_WRITER(), are desccribed in the > > "ACCESS-DOCUMENTATION OPTIONS" section below. > > s/desccribed/described/ Good eyes, fixed! > > ------------------------------------------------------------------------ > > > > Would that work? > > It works for me, if we agree that "negative marking" makes sense: if > the other markings indicate the access is happening concurrently with > others, a negative marking does the opposite. Very good, I will send this out shortly after v6.10-rc1 comes out and let's see where the bikeshedding leads. ;-) Thanx, Paul