Re: [PATCH 15/15] workqueue: deprecate __cancel_delayed_work()

From: Tomi Valkeinen
Date: Tue Jul 31 2012 - 09:05:38 EST


Hi,

On Fri, 2012-07-27 at 16:55 -0700, Tejun Heo wrote:
> __cancel_delayed_work() is different from cancel_delayed_work() in
> that it uses del_timer() instead of del_timer_sync(). This adds
> confusion to already complicated flush / cancel API and given that the
> only thing delayed_work->timer does is queueing the work, the
> difference between cancel_delayed_work() and __cancel_delayed_work()
> isn't anything material.
>
> Furthermore, none of the remaining users are on hot path racing
> against high-frequency work item making the chance of actually waiting
> for delayed_work_timer_fn() very slim.
>
> Use cancel_delayed_work() instead of __cancel_delayed_work() and mark
> the latter deprecated.

I used __cancel_delayed_work() in drivers/video/omap2/dss/dsi.c as the
cancel is done in an interrupt handler. Is it safe to use
cancel_delayed_work() in atomic context? I presume not, as it uses
del_timer_sync().

Tomi

Attachment: signature.asc
Description: This is a digitally signed message part