[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJhGHyBHsu_o02eZ4HWHhuFVXtVUR-sH_W8gFXw7QbLOBm+k+g@mail.gmail.com>
Date: Tue, 20 Feb 2024 15:23:53 +0800
From: Lai Jiangshan <jiangshanlai@...il.com>
To: Tejun Heo <tj@...nel.org>
Cc: torvalds@...ux-foundation.org, linux-kernel@...r.kernel.org,
allen.lkml@...il.com, kernel-team@...a.com
Subject: Re: [PATCH 13/17] workqueue: Remove WORK_OFFQ_CANCELING
Hello, Tejun
On Sat, Feb 17, 2024 at 2:06 AM Tejun Heo <tj@...nel.org> wrote:
> @@ -2631,19 +2567,13 @@ bool mod_delayed_work_on(int cpu, struct workqueue_struct *wq,
> struct delayed_work *dwork, unsigned long delay)
> {
> unsigned long irq_flags;
> - int ret;
> + bool ret;
>
> - do {
> - ret = try_to_grab_pending(&dwork->work, WORK_CANCEL_DELAYED,
> - &irq_flags);
> - } while (unlikely(ret == -EAGAIN));
> + ret = work_grab_pending(&dwork->work, WORK_CANCEL_DELAYED, &irq_flags);
>
> - if (likely(ret >= 0)) {
> - __queue_delayed_work(cpu, wq, dwork, delay);
> - local_irq_restore(irq_flags);
> - }
> + __queue_delayed_work(cpu, wq, dwork, delay);
The disable count has to be checked before queuing it.
Thanks
Lai
>
> - /* -ENOENT from try_to_grab_pending() becomes %true */
> + local_irq_restore(irq_flags);
> return ret;
> }
> EXPORT_SYMBOL_GPL(mod_delayed_work_on);
Powered by blists - more mailing lists