[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160125191909.GF3628@mtj.duckdns.org>
Date: Mon, 25 Jan 2016 14:19:09 -0500
From: Tejun Heo <tj@...nel.org>
To: Petr Mladek <pmladek@...e.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Oleg Nesterov <oleg@...hat.com>,
Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Steven Rostedt <rostedt@...dmis.org>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Josh Triplett <josh@...htriplett.org>,
Thomas Gleixner <tglx@...utronix.de>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Jiri Kosina <jkosina@...e.cz>, Borislav Petkov <bp@...e.de>,
Michal Hocko <mhocko@...e.cz>, linux-mm@...ck.org,
Vlastimil Babka <vbabka@...e.cz>, linux-api@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 10/22] kthread: Allow to modify delayed kthread work
On Mon, Jan 25, 2016 at 04:44:59PM +0100, Petr Mladek wrote:
> +bool mod_delayed_kthread_work(struct kthread_worker *worker,
> + struct delayed_kthread_work *dwork,
> + unsigned long delay)
> +{
> + struct kthread_work *work = &dwork->work;
> + unsigned long flags;
> + int ret = 0;
> +
> +try_again:
> + spin_lock_irqsave(&worker->lock, flags);
> + WARN_ON_ONCE(work->worker && work->worker != worker);
> +
> + if (work->canceling)
> + goto out;
> +
> + ret = try_to_cancel_kthread_work(work, &worker->lock, &flags);
> + if (ret == -EAGAIN)
> + goto try_again;
> +
> + if (work->canceling)
Does this test need to be repeated? How would ->canceling change
while worker->lock is held?
Thanks.
--
tejun
Powered by blists - more mailing lists