RT and timers
From: Daniel Walker
Date: Thu Jun 09 2005 - 17:27:18 EST
George,
I wanted to show you the code below, from the RT patch. I think
it's possible that, if the code isn't changed in the way below, the
while() loop could run forever. If jiffies is very fast moving , and the
softirqd is low priority. Do you have any comments on this?
Daniel
@@ -436,13 +437,30 @@ static int cascade(tvec_base_t *base, tv
static inline void __run_timers(tvec_base_t *base)
{
struct timer_list *timer;
+ unsigned long jiffies_sample = jiffies;
spin_lock_irq(&base->lock);
- while (time_after_eq(jiffies, base->timer_jiffies)) {
+ while (time_after_eq(jiffies_sample, base->timer_jiffies)) {
struct list_head work_list = LIST_HEAD_INIT(work_list);
struct list_head *head = &work_list;
int index = base->timer_jiffies & TVR_MASK;
-
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/