mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Marco Crivellari <marco.crivellari@suse.com>
Cc: linux-kernel@vger.kernel.org,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Frederic Weisbecker <frederic@kernel.org>,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	Michal Hocko <mhocko@suse.com>, Breno Leitao <leitao@debian.org>
Subject: Re: [PATCH v3 2/2] workqueue: Add warnings and ensure one among WQ_PERCPU or WQ_UNBOUND is present
Date: Thu, 28 May 2026 06:25:23 -1000	[thread overview]
Message-ID: <ahhsc8vt-JZwpO1o@slm.duckdns.org> (raw)
In-Reply-To: <20260528160159.471265-3-marco.crivellari@suse.com>

On Thu, May 28, 2026 at 06:01:59PM +0200, Marco Crivellari wrote:
...
> @@ -5850,6 +5850,23 @@ static struct workqueue_struct *__alloc_workqueue(const char *fmt,
>  		pr_warn_once("workqueue: name exceeds WQ_NAME_LEN. Truncating to: %s\n",
>  			     wq->name);
>  
> +	/*
> +	 * One among WQ_PERCPU and WQ_UNBOUND must be set, but not both.
> +	 * - If neither is set, default to WQ_PERCPU
> +	 * - If both are set, default to WQ_UNBOUND
> +	 *
> +	 * This code can be removed after workqueue are unbound by default
> +	 */
> +	if (!(flags & (WQ_UNBOUND | WQ_PERCPU))) {
> +		pr_warn_ratelimited("workqueue: %s is using neither WQ_PERCPU or WQ_UNBOUND. "
> +			"Setting WQ_PERCPU.\n", wq->name);
> +		flags |= WQ_PERCPU;
> +	} else if((flags & WQ_PERCPU) && (flags & WQ_UNBOUND)) {
> +		pr_warn_ratelimited("workqueue: %s uses both WQ_PERCPU and WQ_UNBOUND. "
> +			"Dropped WQ_PERCPU, keeping WQ_UNBOUND.\n", wq->name);
> +		flags &= (~WQ_PERCPU);
> +	}

Let's just WARN_ONCE() on these. These are outright bugs, right?

Thanks.

-- 
tejun

  reply	other threads:[~2026-05-28 16:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-28 16:01 [PATCH v3 0/2] workqueue: Add warnings and check WQ flags usage Marco Crivellari
2026-05-28 16:01 ` [PATCH v3 1/2] workqueue: Add warnings and fallback if system_{unbound}_wq is used Marco Crivellari
2026-05-28 16:18   ` Breno Leitao
2026-05-29  8:30     ` Marco Crivellari
2026-05-28 16:01 ` [PATCH v3 2/2] workqueue: Add warnings and ensure one among WQ_PERCPU or WQ_UNBOUND is present Marco Crivellari
2026-05-28 16:25   ` Tejun Heo [this message]
2026-05-29  8:48     ` Marco Crivellari

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=ahhsc8vt-JZwpO1o@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=bigeasy@linutronix.de \
    --cc=frederic@kernel.org \
    --cc=jiangshanlai@gmail.com \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marco.crivellari@suse.com \
    --cc=mhocko@suse.com \
    /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®