+ s390-next_timer_interrupt-overflow-in-stop_hz_timer.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     s390: next_timer_interrupt overflow in stop_hz_timer

has been added to the -mm tree.  Its filename is

     s390-next_timer_interrupt-overflow-in-stop_hz_timer.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: s390: next_timer_interrupt overflow in stop_hz_timer
From: Martin Schwidefsky <schwidefsky@xxxxxxxxxx>


The 32 bit unsigned substraction (next - jiffies) in stop_hz_timer can
overflow if jiffies gets advanced between next_timer_interrupt and the read
under the xtime lock.  The cast to a u64 then results in a large value
which causes the cpu to wait too long.  Fix this by casting next and
jiffies independently to u64 before subtracting them.

(Spotted by Zachary Amsden <zach@xxxxxxxxxx>)

Signed-off-by: Martin Schwidefsky <schwidefsky@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 arch/s390/kernel/time.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN arch/s390/kernel/time.c~s390-next_timer_interrupt-overflow-in-stop_hz_timer arch/s390/kernel/time.c
--- devel/arch/s390/kernel/time.c~s390-next_timer_interrupt-overflow-in-stop_hz_timer	2006-05-19 02:31:36.000000000 -0700
+++ devel-akpm/arch/s390/kernel/time.c	2006-05-19 02:31:36.000000000 -0700
@@ -272,7 +272,7 @@ static inline void stop_hz_timer(void)
 	next = next_timer_interrupt();
 	do {
 		seq = read_seqbegin_irqsave(&xtime_lock, flags);
-		timer = (__u64)(next - jiffies) + jiffies_64;
+		timer = (__u64 next) - (__u64 jiffies) + jiffies_64;
 	} while (read_seqretry_irqrestore(&xtime_lock, seq, flags));
 	todval = -1ULL;
 	/* Be careful about overflows. */
_

Patches currently in -mm which might be from schwidefsky@xxxxxxxxxx are

origin.patch
fix-a-no_idle_hz-timer-bug.patch
s390-next_timer_interrupt-overflow-in-stop_hz_timer.patch
create-sys-hypervisor-when-needed.patch
s390_hypfs-filesystem.patch
s390-statistics-infrastructure.patch
adjust-handle_irr_event-return-type.patch
define-__raw_get_cpu_var-and-use-it.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux