Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp96717lqo; Wed, 15 May 2024 23:35:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXi05frxP8tRrm6ieKBgOIIiGvmdqc6nWDHIDxTEL6ZGBJ0GN3O15RPQyq89/1SnEpte9SOMnWHgOqo4oEqqEbIgzufFa811wG2Uj/QAQ== X-Google-Smtp-Source: AGHT+IE8ZLA/jdZdikiY7OtqaE36B5jtHrKq+a+UUrAxxRwPz3imsZFW2FL7YnhYqzvCzZJd4yFt X-Received: by 2002:a05:6214:5902:b0:6a0:c765:80c3 with SMTP id 6a1803df08f44-6a16818006cmr201728396d6.31.1715841349154; Wed, 15 May 2024 23:35:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715841349; cv=pass; d=google.com; s=arc-20160816; b=HVtoV5PTkgH09HMfG4wLrYKWwd6h1XwF5fTkLIykngE/9unB4p+fYJ7Y71XIJ43Y8Q 4XOoZPMegyxt+L6HJz8ivO7ryFc5Td54Vioh3sEwyZIR/9Cnin8VwSFDvgkla+2wG6Lu kQJ4nTLEoQdmzMqcOATLmUoVYcLKJvtPP1l+5+RWxstmeXvbIQtKvzty4QG8HGhli6QW 6l5vLJCwQD1beJqVqaxPKiUPEI49OMzNsrzdnBdTTdIhR+zd5+BveO1/vi56UrRv4ZJc Tyb0NxhsNiA1izRN1sQj4TRJ6sV0Zv4g/8qUbh9KI8Xn616TU8tG/L1UkbcFkarTgzNj Ezyw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=bmfXEWdtGqKswH9Xu4JgGerg0k5E2Nij58vjYt+4SMk=; fh=EUsVzMcMx/BkBIeh3jXe4MszDQewnR6j3MKj2Vj0VP0=; b=WtTNoA4w4hgh+Ha2DKL5AxtVrOBcXGZQIjr0Lm6GEqezk+Aj33MgDT6G88wJKTJKRO IHLC4So3rS+REhx77qD83prV/hIBm8sGgbGjwyEOk9XRsxl0tNK8VorWAQbp74cUe4WB GeFthEZlb4/IkAqtzU6LehKOkxJp3S4XvaMusayaD8C1Y7Q+GKnhGLR5x7K5ys0EKqG0 0GcYS40sI1f8lvtlwHQOsYniR20jnruUNw1X+79NQRfD9qdXC6uez60+/lowHRJShNiE JElbwjP2KLeb+uc97ZvS0yuUmeBReF6TnAor3l12ARSQmMvTZON3mmX/HArjkV/lUtRm uidQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="j/fVSDIr"; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-180678-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180678-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6a15f1d82c7si158242086d6.6.2024.05.15.23.35.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 23:35:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180678-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="j/fVSDIr"; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-180678-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180678-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id DF1A31C20E50 for ; Thu, 16 May 2024 06:35:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0F9FD2554B; Thu, 16 May 2024 06:35:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="j/fVSDIr" Received: from mail-vs1-f45.google.com (mail-vs1-f45.google.com [209.85.217.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D0E1D171AF for ; Thu, 16 May 2024 06:35:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715841341; cv=none; b=s4gUnNL8KX0X0pvtOyaedhQCw7IUoGG0WCYaRTBjJaPQ2QxT5juFrTvandXvynVi1c6jE6MtDITcg5A83ZBXcp/YRU70PAPRKSqrmigb32ydZWpuBqY7zmdm980+beD0XoYjeXK4i3p0907WxeeVgmNcWOLTiNp7jAwoynFOjSg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715841341; c=relaxed/simple; bh=4qYPgB7w3VWHV5nxyHVEaF4494UUC1haBn1zRSaJ8Ug=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=tcc2KtsFuIXdwZiaRSWkanphSK7fdPNnPlIRCP+9vpJzuzz0LNDNBXM3+RxSqKwvIF4uzjm9KDDGW+jr35r/hc9NoETIlqOGsEvHss8/pOBe38BkZnbDHoP4SZ7mP9dr3bsJsRNUC+R/fhoecUzzGaNdUB/LHgGoOf4yyCXgSbA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=j/fVSDIr; arc=none smtp.client-ip=209.85.217.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-vs1-f45.google.com with SMTP id ada2fe7eead31-47f3e985a84so2702157137.2 for ; Wed, 15 May 2024 23:35:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715841339; x=1716446139; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=bmfXEWdtGqKswH9Xu4JgGerg0k5E2Nij58vjYt+4SMk=; b=j/fVSDIr1fv4dg62OLMX+mJF4ZPwXWPZzWV7Vk3yARcSBOKcIAlee4CEWYwIPp+O0b 14TLIHZdOw4+Dd0x1I8ZQJBbpesP4eKBn9jb4KuwJl2Mfn4Y6NQtg4zRH3gaNEhdvbVm dQT+qSUuB8zWjXbDpA4LrTpA6vq9C6hAMDgrNx+kYiAYznBeElgj/QHl18gkoiZmgc8B VI5fLUxRVmOfr6fVLVjka7F4RUwc2/o/thg1wwOA8vuBFxf+BKmPRWFeWQUkHqaX7jjB +3u34d8Zei5zLf80rKcNtLtVWvUsV0oo8GrSkr5kIoanozzuvGX5MGhWi/SWSryKT2D6 BLjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715841339; x=1716446139; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bmfXEWdtGqKswH9Xu4JgGerg0k5E2Nij58vjYt+4SMk=; b=Ja/A6KZ6kZfwAUlMCFgowRGDGY/VMX/vfMRPXii7Z9CtclcI97cVf78WtDveRfALC7 wTQDjsgzKYQzDvyYSEGRDND5ekFZbbP/deVFtDo9gxahdEOTzB25rW3fO2jt5C/4aSCq YypUYQMELAtx/57Ld6yHVJY8zmLfxGQ8mw6mdeJx51T7ece68dRyloOhF43Rrd9Sa2ZG oxL7WQ8sicgPmpCwwxnddpmXLTM1H5VlpuVru1uplSmZ3xhNBjXSiBv+3Zld+kPMxEMz 5K6M9X2c50hWDrWaJtF8nkctqFlUKphbuFPN4OI5xwptPkV/cNLfKF+0EiDG+XnVIoUe gsrQ== X-Forwarded-Encrypted: i=1; AJvYcCXNUXaC/zpC6mn5cFnd8Y8PrMd3amYjbakXPVnHKVMgdphO5DonwQs9XRCazdGoBhFDkJT0/hXP5dDHDLMwW8UDuiDrp6JjnrlAlJdy X-Gm-Message-State: AOJu0YxNkF++jSCLbiopgskEXonUuVJC1W52HqQBGUxvX2LPMJYp+LCq Uxj7EPxW3IvK6KMAgb30QcGdVjwiwYViP2Lfy6c2f67bSF2XRd0fI8OpTcO97UasO+veeXuclie ji3BF1EI7C3JA5PhyAwsZ7ZL1NWHiPHl3m8et X-Received: by 2002:a05:6102:a47:b0:47e:ee4b:5e83 with SMTP id ada2fe7eead31-48077e87f61mr19122474137.25.1715841338556; Wed, 15 May 2024 23:35:38 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <4d230bac-bdb0-4a01-8006-e95156965aa8@acm.org> <447ad732-3ff8-40bf-bd82-f7be66899cee@paulmck-laptop> <59ec96c2-52ce-4da1-92c3-9fe38053cd3d@paulmck-laptop> <75421237-4c5a-48bc-849e-87a216ee9d32@paulmck-laptop> In-Reply-To: From: Marco Elver Date: Thu, 16 May 2024 08:35:02 +0200 Message-ID: Subject: Re: [PATCH] block: Annotate a racy read in blk_do_io_stat() To: paulmck@kernel.org Cc: Bart Van Assche , Breno Leitao , Jens Axboe , "open list:BLOCK LAYER" , open list Content-Type: text/plain; charset="UTF-8" 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/ > ------------------------------------------------------------------------ > > 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. Thanks, -- Marco