All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Breno Leitao <leitao@debian.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: paulmck@kernel.org,
	"open list:DEBUGOBJECTS:" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] debugobjects: Fix potential data race in debug_objects_maxchain
Date: Fri, 24 May 2024 21:26:17 +0200	[thread overview]
Message-ID: <871q5rdnae.ffs@tglx> (raw)
In-Reply-To: <20240509110612.768196-1-leitao@debian.org>

On Thu, May 09 2024 at 04:06, Breno Leitao wrote:
> -	if (cnt > debug_objects_maxchain)
> -		debug_objects_maxchain = cnt;
> +	if (cnt > READ_ONCE(debug_objects_maxchain))
> +		WRITE_ONCE(debug_objects_maxchain, cnt);

The data race is actually harmless as this is just used for debugfs
statistics.

I'm pretty sure that the rest of these debug variables are racy as
well. Can we please annotate all of them without waiting for KCSAN to
detect them one by one?

Thanks,

        tglx

      reply	other threads:[~2024-05-24 19:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-09 11:06 [PATCH] debugobjects: Fix potential data race in debug_objects_maxchain Breno Leitao
2024-05-24 19:26 ` Thomas Gleixner [this message]

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=871q5rdnae.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=akpm@linux-foundation.org \
    --cc=leitao@debian.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.