public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: paulmck@kernel.org
Cc: Breno Leitao <leitao@debian.org>, Jens Axboe <axboe@kernel.dk>,
	"open list:BLOCK LAYER" <linux-block@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	Marco Elver <elver@google.com>
Subject: Re: [PATCH] block: Annotate a racy read in blk_do_io_stat()
Date: Fri, 10 May 2024 16:22:58 -0700	[thread overview]
Message-ID: <ca7c2ef0-7e21-4fb3-ac6b-3dae652a7a0e@acm.org> (raw)
In-Reply-To: <447ad732-3ff8-40bf-bd82-f7be66899cee@paulmck-laptop>

On 5/10/24 3:35 PM, Paul E. McKenney wrote:
> diff --git a/include/linux/compiler.h b/include/linux/compiler.h
> index c00cc6c0878a1..78593b40fe7e9 100644
> --- a/include/linux/compiler.h
> +++ b/include/linux/compiler.h
> @@ -194,9 +194,18 @@ void ftrace_likely_update(struct ftrace_likely_data *f, int val,
>    * This data_race() macro is useful for situations in which data races
>    * should be forgiven.  One example is diagnostic code that accesses
>    * shared variables but is not a part of the core synchronization design.
> + * For example, if accesses to a given variable are protected by a lock,
> + * except for diagnostic code, then the accesses under the lock should
> + * be plain C-language accesses and those in the diagnostic code should
> + * use data_race().  This way, KCSAN will complain if buggy lockless
> + * accesses to that variable are introduced, even if the buggy accesses
> + * are protected by READ_ONCE() or WRITE_ONCE().
> + *
> + * This macro *does not* affect normal code generation, but is a hint to
> + * tooling that data races here are to be ignored.  If code generation must
> + * be protected *and* KCSAN should ignore the access, use both data_race()
> + * and READ_ONCE(), for example, data_race(READ_ONCE(x)).
>    *
> - * This macro *does not* affect normal code generation, but is a hint
> - * to tooling that data races here are to be ignored.
>    */

This patch changes the end of the comment from "*/" into "*\n*/".
That's probably unintended? Otherwise this patch looks good to me.

Thanks,

Bart.


  reply	other threads:[~2024-05-10 23:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-10 14:19 [PATCH] block: Annotate a racy read in blk_do_io_stat() Breno Leitao
2024-05-10 14:28 ` Bart Van Assche
2024-05-10 14:57   ` Breno Leitao
2024-05-10 15:41   ` Paul E. McKenney
2024-05-10 16:20     ` Bart Van Assche
2024-05-10 17:08       ` Paul E. McKenney
2024-05-10 20:30         ` Bart Van Assche
2024-05-10 22:35           ` Paul E. McKenney
2024-05-10 23:22             ` Bart Van Assche [this message]
2024-05-11  0:41               ` Paul E. McKenney
2024-05-13  8:13                 ` Marco Elver
2024-05-14 23:47                   ` Paul E. McKenney
2024-05-15  7:58                     ` Marco Elver
2024-05-15 12:48                       ` Breno Leitao
2024-05-15 13:20                         ` Marco Elver
2024-05-15 15:57                       ` Paul E. McKenney
2024-05-15 17:40                         ` Marco Elver
2024-05-15 21:51                           ` Paul E. McKenney
2024-05-16  6:35                             ` Marco Elver
2024-05-20 18:05                               ` Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ca7c2ef0-7e21-4fb3-ac6b-3dae652a7a0e@acm.org \
    --to=bvanassche@acm.org \
    --cc=axboe@kernel.dk \
    --cc=elver@google.com \
    --cc=leitao@debian.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox