mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: imran.f.khan@oracle.com
Cc: jiangshanlai@gmail.com, haakon.bugge@oracle.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] workqueue: introduce queue_delayed_work_on_offline_safe
Date: Thu, 6 Feb 2025 06:34:22 -1000	[thread overview]
Message-ID: <Z6TkjhgSgzzTnm4t@slm.duckdns.org> (raw)
In-Reply-To: <c842fb2d-47e9-4b20-a5db-f55730b2c093@oracle.com>

On Wed, Feb 05, 2025 at 11:54:20AM +1100, imran.f.khan@oracle.com wrote:
...
> The problem is for the cases where a CPU is already offline or in the
> middle of being offlined and past timers_dead_cpu callback. In such a
> scenario if someone puts a delayed work on this CPU, we have problem. 
> The WARN_ON_ONCE in [1] can indicate  this but the dwork's timer would
> still end up on the offlined cpu and will not be migrated (since CPU was
> past timer_dead state , when dwork was queued).
> 
> One way to avoid this is that we ask callers to do the needful (hotplug lock,
> hotplug callbacks) and ensure dwork does not end up on such offlined CPU.
> The other way (as attempted in this patch) would be to give such users an
> interface, that can ensure that  dwork never ends on on offlined CPU.

I don't think introducing a new interface makes sense here. Either the WARN
is enough or we can follow what queue_work_on() does and ensure that the
delayed work item gets executed *somewhere*.

Thanks.

-- 
tejun

      reply	other threads:[~2025-02-06 16:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-04 11:36 Imran Khan
2025-02-04 19:17 ` Tejun Heo
2025-02-05  0:54   ` imran.f.khan
2025-02-06 16:34     ` 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=Z6TkjhgSgzzTnm4t@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=haakon.bugge@oracle.com \
    --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®