[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200703072818.GC11587@alley>
Date: Fri, 3 Jul 2020 09:28:18 +0200
From: Petr Mladek <pmladek@...e.com>
To: qiang.zhang@...driver.com
Cc: ben.dooks@...ethink.co.uk, bfields@...hat.com, cl@...k-chips.com,
peterz@...radead.org, tj@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kthread: Don't cancel a work that is being cancelled
On Thu 2020-07-02 12:43:24, qiang.zhang@...driver.com wrote:
> From: Zhang Qiang <qiang.zhang@...driver.com>
>
> When canceling a work, if it is found that the work is in
> the cancelling state, we should directly exit the cancelled
> operation.
No, the function guarantees that the work is not longer running
when it returns. This is why it has the suffix "_sync" in the name.
We would need to add kthread_cancel_work() without the "_sync"
wrappers that would not wait for the work in progress. But it
might be dangerous. The API users usually want to make sure
that the work in not longer running to avoid races.
What is the use case for the non-sync behavior, please?
Best Regards,
Petr
Powered by blists - more mailing lists