[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZdT1GghILBWPMfLV@slm.duckdns.org>
Date: Tue, 20 Feb 2024 08:53:14 -1000
From: Tejun Heo <tj@...nel.org>
To: Lai Jiangshan <jiangshanlai@...il.com>
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
On Tue, Feb 20, 2024 at 03:23:53PM +0800, Lai Jiangshan wrote:
> 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.
Ah, right, this also needs a clear_pending_if_disabled() call.
Thanks.
--
tejun
Powered by blists - more mailing lists