mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Yunlong Xing <yunlong.xing@unisoc.com>
Cc: jiangshanlai@gmail.com, yunlong.xing23@gmail.com,
	linux-kernel@vger.kernel.org, hongyu.jin@unisoc.com,
	zhiguo.niu@unisoc.com, zhengxu.zhang@unisoc.com
Subject: Re: [PATCH] workqueue: Fix pool->nr_running type back to atomic
Date: Tue, 6 Feb 2024 06:52:41 -1000	[thread overview]
Message-ID: <ZcJj2dUUyAY_7XFS@slm.duckdns.org> (raw)
In-Reply-To: <20240206080024.2373490-1-yunlong.xing@unisoc.com>

Hello,

On Tue, Feb 06, 2024 at 04:00:24PM +0800, Yunlong Xing wrote:
> In CPU-hotplug test, when plug the core, set_cpus_allowed_ptr() restoring
> the cpus_mask of the per-cpu worker may fail, the cpus_mask of the worker
> remain wq_unbound_cpumask until the core hotpluged next time. so, workers
> in the same per-cpu pool can run concurrently and change nr_running at the
>  same time, atomic problem occur.

How would set_cpus_allowed_ptr() fail? That should trigger WARN_ON, right?
If set_cpus_allowed_ptr() fails, nr_running getting desynchronized is only a
part of the problem. We will end up running per-cpu work items which must
execute on the same CPU on foreign CPUs.

Thanks.

-- 
tejun

  reply	other threads:[~2024-02-06 16:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-06  8:00 Yunlong Xing
2024-02-06 16:52 ` Tejun Heo [this message]
2024-02-07  2:06   ` yunlong xing
2024-02-07  3:13     ` Tejun Heo

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=ZcJj2dUUyAY_7XFS@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=hongyu.jin@unisoc.com \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yunlong.xing23@gmail.com \
    --cc=yunlong.xing@unisoc.com \
    --cc=zhengxu.zhang@unisoc.com \
    --cc=zhiguo.niu@unisoc.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®