lkml.org 
[lkml]   [2011]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[RFC] Add mod_delayed_work()
Date
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



\
 
 \ /
  Last update: 2011-06-25 00:29    [from the cache]
©2003-2011 Jasper Spaans