public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] Add mod_delayed_work()
@ 2011-06-24 22:27 Gustavo F. Padovan
  2011-06-24 22:27 ` [RFC 1/1] workqueue: " Gustavo F. Padovan
  0 siblings, 1 reply; 4+ messages in thread
From: Gustavo F. Padovan @ 2011-06-24 22:27 UTC (permalink / raw)
  To: tj; +Cc: linux-kernel, padovan, marcel, a.p.zijlstra, akpm

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-06-28 18:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-24 22:27 [RFC] Add mod_delayed_work() Gustavo F. Padovan
2011-06-24 22:27 ` [RFC 1/1] workqueue: " Gustavo F. Padovan
2011-06-25 11:43   ` Tejun Heo
2011-06-28 18:16     ` Gustavo F. Padovan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox