Reputation: 47
queue_delayed_work(struct workqueue_struct *wq,struct delayed_work *dwork,unsigned long delay)
In the above function, is it possible to give delay that is less than one jiffy?
Upvotes: 1
Views: 934
Reputation: 47
when we call wait_event_interruptible ( wq, condition) is it mandatory to call wake_up function when we use wait_event_interruptible ?
Upvotes: 0
Reputation: 1116
You can give a delay of zero or more jiffies. To get delay, kernel internally uses a timer. The earliest timer can expire is on the closest next tick. therefore the smallest delay possible is of 1 jiffies. In case of zero jiffies, the delayed work (dwork) will immediately start without any delay.
queue_delayed_work internally calls __queue_delayed_work where implementation for configuring timer is done. The minimum expire time is jiffies + delay. Refer links for more information.
To schedule your work less than jiffiy timer, You can make use of hrtimers(high resolution timer).
For more information related to implementing hrtimer read followinf links :
hrtimer repeating task in the Linux kernel
https://www.ibm.com/developerworks/library/l-timers-list/
Upvotes: 1
Reputation: 3273
The only delay which would be less than one jiffy is 0 jiffies in case of queue_delayed_work
.
delay
has type unsigned long
and it's specified as "number of jiffies to wait before queueing".
Upvotes: 0