mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Breno Leitao <leitao@debian.org>
To: Nguyen Ngoc Thang <ngocthang2710.1999@gmail.com>
Cc: Tejun Heo <tj@kernel.org>, Lai Jiangshan <jiangshanlai@gmail.com>,
	 linux-kernel@vger.kernel.org,
	syzbot+8922e6b8343f70be92e8@syzkaller.appspotmail.com
Subject: Re: [PATCH v2] workqueue: annotate the lockless nr_running increment racing with need_more_worker()
Date: Wed, 14 Oct 2026 02:19:57 -0700	[thread overview]
Message-ID: <as9JD--_aa9nsfdR@gmail.com> (raw)
In-Reply-To: <20261013112905.9673-1-ngocthang2710.1999@gmail.com>

On Tue, Oct 13, 2026 at 06:29:05PM +0700, Nguyen Ngoc Thang wrote:
>  static bool need_more_worker(struct worker_pool *pool)
>  {
> -	return !list_empty(&pool->worklist) && !pool->nr_running;
> +	/* Racy against the lockless increment, see @nr_running. */
> +	return !list_empty(&pool->worklist) && !data_race(pool->nr_running);

Isn't it better to annotate the nr_running field in the structure, rather than
at reading time?

  reply	other threads:[~2026-10-14  9:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-13 11:29 Nguyen Ngoc Thang
2026-10-14  9:19 ` Breno Leitao [this message]
2026-10-14 15:44 ` Nguyen Ngoc Thang

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=as9JD--_aa9nsfdR@gmail.com \
    --to=leitao@debian.org \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ngocthang2710.1999@gmail.com \
    --cc=syzbot+8922e6b8343f70be92e8@syzkaller.appspotmail.com \
    --cc=tj@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

all inboxes | Powered by JetHome®