From: Tejun Heo <tj@kernel.org>
To: Imran Khan <imran.f.khan@oracle.com>
Cc: jiangshanlai@gmail.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] workqueue: warn if delayed_work is queued to an offlined cpu.
Date: Fri, 10 Jan 2025 08:33:59 -1000 [thread overview]
Message-ID: <Z4FoF8471fQSHPXm@slm.duckdns.org> (raw)
In-Reply-To: <20250109232711.2081259-1-imran.f.khan@oracle.com>
On Fri, Jan 10, 2025 at 10:27:11AM +1100, Imran Khan wrote:
> delayed_work submitted to an offlined cpu, will not get executed,
> after the specified delay if the cpu remains offline. If the cpu
> never comes online the work will never get executed.
> checking for online cpu in __queue_delayed_work, does not sound
> like a good idea because to do this reliably we need hotplug lock
> and since work may be submitted from atomic contexts, we would
> have to use cpus_read_trylock. But if trylock fails we would queue
> the work on any cpu and this may not be optimal because our intended
> cpu might still be online.
>
> Putting a WARN_ON_ONCE for an already offlined cpu, will indicate users
> of queue_delayed_work_on, if they are (wrongly) trying to queue
> delayed_work on offlined cpu. Also indicate the problem of using
> offlined cpu with queue_delayed_work_on, in its description.
>
> Signed-off-by: Imran Khan <imran.f.khan@oracle.com>
Applied to wq/for-6.13-fixes.
Thanks.
--
tejun
prev parent reply other threads:[~2025-01-10 18:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-09 23:27 Imran Khan
2025-01-10 18:33 ` Tejun Heo [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=Z4FoF8471fQSHPXm@slm.duckdns.org \
--to=tj@kernel.org \
--cc=imran.f.khan@oracle.com \
--cc=jiangshanlai@gmail.com \
--cc=linux-kernel@vger.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®