[RFC] Add mod_delayed_work()

From: Gustavo F. Padovan
Date: Fri Jun 24 2011 - 18:27:38 EST


Hi,

In the work to move Bluetooth RX processing to workqueues I faced some
issues when trying to move our timers to workqueue, including deadlocks.
We use mod_timer() a lot to reset timer's delay, but the alternative with
workqueues is

cancel_delayed_work_sync(work);
queue_delayed_work(wq, work, delay);

This is too much for a simple change in the delay, so I did some research on
this and found that other pieces[0] in the kernel may have the same needs and
cooked a patch to create mod_delayed_work(). I used this name because we
basically call mod_timer there (or queue the work if it is not pending).

Then I propose replace the two lines above with:
mod_delayed_work(wq, work, delay);

Please comment.

Gustavo

[0] https://lkml.org/lkml/2011/2/3/175

Gustavo F. Padovan (1):
workqueue: Add mod_delayed_work()

include/linux/workqueue.h | 2 ++
kernel/workqueue.c | 26 ++++++++++++++++++++++++++
2 files changed, 28 insertions(+), 0 deletions(-)

--
1.7.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/