From: "Jan Beulich" Subject: [PATCH] linux: fix condition for entering tickless state Date: Fri, 09 Mar 2007 16:54:17 +0000 Message-ID: <45F19F49.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org 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). Signed-off-by: Jan Beulich Index: ./patches/linux-2.6.18/softlockup-no-idle-hz.patch =================================================================== --- ./patches/linux-2.6.18/softlockup-no-idle-hz.patch +++ ./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); +} + /*