Skip to contentSkip to conversation

linux: fix condition for entering tickless state

PATCH In review Jan Beulich 2 participants 2 messages Mar 9, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux: fix condition for entering tickless state

I noticed that timer interrupts were running at full rate regardless of whether the system was idle. softlockup_get_next_event() must return the maximum of zero and the delta to the next event, not the minimum (which is always zero or negative, yielding zero or a very large positive number as return value).

patches/linux-2.6.18/softlockup-no-idle-hz.patch +1 -1
Index: ./patches/linux-2.6.18/softlockup-no-idle-hz.patch
===================================================================
@@ -34,7 +34,7 @@ unsigned long softlockup_get_next_event(
 +			!per_cpu(watchdog_task, this_cpu))
 +		return MAX_JIFFY_OFFSET;
 +
-+	return min_t(long, 0, touch_timestamp + HZ - jiffies);
++	return max_t(long, 0, touch_timestamp + HZ - jiffies);
 +}
 +
  /*
#1 lore raw
Quoted 6 lines · Jan Beulich

I noticed that timer interrupts were running at full rate regardless of whether the system was idle. softlockup_get_next_event() must return the maximum of zero and the delta to the next event, not the minimum (which is always zero or negative, yielding zero or a very large positive number as return value).

Oops. :-)

K.