lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-623c4f89c47cca0088014388211d8bc0a5358f0a@git.kernel.org>
Date:	Wed, 30 Sep 2009 20:40:15 GMT
From:	tip-bot for Eric Dumazet <eric.dumazet@...il.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
	eric.dumazet@...il.com, a.p.zijlstra@...llo.nl,
	johnstul@...ibm.com, torvalds@...ux-foundation.org,
	arjan@...ux.intel.com, schwidefsky@...ibm.com, tglx@...utronix.de,
	mingo@...e.hu
Subject: [tip:sched/urgent] sched_clock: Fix atomicity/continuity bug by using cmpxchg64()

Commit-ID:  623c4f89c47cca0088014388211d8bc0a5358f0a
Gitweb:     http://git.kernel.org/tip/623c4f89c47cca0088014388211d8bc0a5358f0a
Author:     Eric Dumazet <eric.dumazet@...il.com>
AuthorDate: Wed, 30 Sep 2009 20:36:19 +0200
Committer:  Ingo Molnar <mingo@...e.hu>
CommitDate: Wed, 30 Sep 2009 22:36:12 +0200

sched_clock: Fix atomicity/continuity bug by using cmpxchg64()

Commit def0a9b2573 (sched_clock: Make it NMI safe) assumed
cmpxchg() of 64bit values was available on X86_32.

That is not so - and causes some subtle scheduler misbehavior due
to incorrect timestamps off to up by ~4 seconds.

Two symptoms are known right now:

 - interactivity problems seen by Arjan: up to 600 msecs
   latencies instead of the expected 20-40 msecs. These
   latencies are very visible on the desktop.

 - incorrect CPU stats: occasionally too high percentages in 'top',
   and crazy CPU usage stats.

Reported-by: Martin Schwidefsky <schwidefsky@...ibm.com>
Signed-off-by: Eric Dumazet <eric.dumazet@...il.com>
Signed-off-by: Arjan van de Ven <arjan@...ux.intel.com>
Acked-by: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: John Stultz <johnstul@...ibm.com>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
LKML-Reference: <20090930170754.0886ff2e@...radead.org>
Signed-off-by: Ingo Molnar <mingo@...e.hu>


---
 kernel/sched_clock.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/sched_clock.c b/kernel/sched_clock.c
index ac2e1dc..479ce56 100644
--- a/kernel/sched_clock.c
+++ b/kernel/sched_clock.c
@@ -127,7 +127,7 @@ again:
 	clock = wrap_max(clock, min_clock);
 	clock = wrap_min(clock, max_clock);
 
-	if (cmpxchg(&scd->clock, old_clock, clock) != old_clock)
+	if (cmpxchg64(&scd->clock, old_clock, clock) != old_clock)
 		goto again;
 
 	return clock;
@@ -163,7 +163,7 @@ again:
 		val = remote_clock;
 	}
 
-	if (cmpxchg(ptr, old_val, val) != old_val)
+	if (cmpxchg64(ptr, old_val, val) != old_val)
 		goto again;
 
 	return val;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ