Re: [RFC PATCH] x86 alternatives : fix LOCK_PREFIX race with preemptible kernel and CPU hotplug

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Mathieu Desnoyers <mathieu.desnoyers@...>
Cc: Jeremy Fitzhardinge <jeremy@...>, H. Peter Anvin <hpa@...>, Andi Kleen <andi@...>, Ingo Molnar <mingo@...>, Steven Rostedt <rostedt@...>, Steven Rostedt <srostedt@...>, LKML <linux-kernel@...>, Thomas Gleixner <tglx@...>, Peter Zijlstra <peterz@...>, Andrew Morton <akpm@...>, David Miller <davem@...>, Roland McGrath <roland@...>, Ulrich Drepper <drepper@...>, Rusty Russell <rusty@...>, Gregory Haskins <ghaskins@...>, Arnaldo Carvalho de Melo <acme@...>, Luis Claudio R. Goncalves <lclaudio@...>, Clark Williams <williams@...>, Christoph Lameter <cl@...>
Date: Thursday, August 14, 2008 - 12:10 pm

On Thu, 14 Aug 2008, Mathieu Desnoyers wrote:

Absolutely. 

Locked ops show up not just in microbenchmarks looping over the 
instruction, they show up in "real" benchmarks too. We added a single 
locked instruction (maybe it was two) to the page fault handling code some 
time ago, and the reason I noticed it was that it actually made the page 
fault cost visibly more expensive in lmbench. That was a _single_ 
instruction in the hot path (or maybe two).

And the page fault path is some of the most timing critical in the whole 
kernel - if you have everything cached, the cost of doing the page faults 
to populate new processes for some fork/exec-heavy workload (and compiling 
the kernel is just one of those - any traditional unix behaviour will show 
this) is critical.

This is one of the things AMD does a _lot_ better than Intel. Intel tends 
to have a 30-50 cycle cost (with later P4s being *much* worse), while AMD 
tends to have a cost of around 10-15 cycles.

It's one of the things Intel promises to have improved in the next-gen 
uarch (Nehalem), an while I am not supposed to give out any benchmarks, I 
can confirm that Intel is getting much better at it. But it's going to be 
visible still, and it's really a _big_ issue on P4.

(Of course, on P4, the page fault exception cost itself is so high that 
the cost of atomics may be _relatively_ less noticeable in that particular 
path)

		Linus
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/5] ftrace: to kill a daemon, Steven Rostedt, (Thu Aug 7, 2:20 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Abhishek Sagar, (Sat Aug 9, 5:48 am)
Re: [PATCH 0/5] ftrace: to kill a daemon, Steven Rostedt, (Sat Aug 9, 9:01 am)
Re: [PATCH 0/5] ftrace: to kill a daemon, Abhishek Sagar, (Sat Aug 9, 11:01 am)
Re: [PATCH 0/5] ftrace: to kill a daemon, Steven Rostedt, (Sat Aug 9, 11:37 am)
Re: [PATCH 0/5] ftrace: to kill a daemon, Abhishek Sagar, (Sat Aug 9, 1:14 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Jeremy Fitzhardinge, (Thu Aug 7, 5:11 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Steven Rostedt, (Thu Aug 7, 5:29 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Roland McGrath, (Thu Aug 7, 6:26 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Sam Ravnborg, (Fri Aug 8, 12:54 am)
Re: [PATCH 0/5] ftrace: to kill a daemon, Steven Rostedt, (Thu Aug 7, 9:21 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Peter Zijlstra, (Fri Aug 8, 3:22 am)
Re: [PATCH 0/5] ftrace: to kill a daemon, Steven Rostedt, (Fri Aug 8, 7:31 am)
Re: [PATCH 0/5] ftrace: to kill a daemon, Steven Rostedt, (Thu Aug 7, 9:56 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Steven Rostedt, (Thu Aug 7, 9:24 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Mathieu Desnoyers, (Thu Aug 7, 2:47 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Steven Rostedt, (Thu Aug 7, 4:42 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Mathieu Desnoyers, (Fri Aug 8, 1:22 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Steven Rostedt, (Fri Aug 8, 1:36 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Mathieu Desnoyers, (Fri Aug 8, 1:46 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Steven Rostedt, (Fri Aug 8, 2:13 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Mathieu Desnoyers, (Fri Aug 8, 2:21 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Steven Rostedt, (Fri Aug 8, 2:41 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Rusty Russell, (Sun Aug 10, 10:41 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Steven Rostedt, (Mon Aug 11, 8:33 am)
Re: [PATCH 0/5] ftrace: to kill a daemon, Jeremy Fitzhardinge, (Fri Aug 8, 3:08 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Linus Torvalds, (Fri Aug 8, 3:04 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Mathieu Desnoyers, (Fri Aug 8, 3:05 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Steven Rostedt, (Fri Aug 8, 7:38 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Steven Rostedt, (Fri Aug 8, 8:30 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Mathieu Desnoyers, (Mon Aug 11, 2:21 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Steven Rostedt, (Mon Aug 11, 3:28 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Andi Kleen, (Fri Aug 8, 8:23 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Steven Rostedt, (Fri Aug 8, 8:36 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Andi Kleen, (Fri Aug 8, 9:19 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Steven Rostedt, (Sat Aug 9, 12:12 am)
Re: [PATCH 0/5] ftrace: to kill a daemon, Steven Rostedt, (Fri Aug 8, 9:30 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Andi Kleen, (Fri Aug 8, 9:55 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Steven Rostedt, (Fri Aug 8, 10:03 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Andi Kleen, (Fri Aug 8, 10:23 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Roland McGrath, (Fri Aug 8, 8:53 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Andi Kleen, (Fri Aug 8, 9:13 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Jeremy Fitzhardinge, (Fri Aug 8, 8:47 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Linus Torvalds, (Fri Aug 8, 8:51 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Steven Rostedt, (Fri Aug 8, 9:25 pm)
Efficient x86 and x86_64 NOP microbenchmarks, Mathieu Desnoyers, (Wed Aug 13, 1:52 pm)
Re: Efficient x86 and x86_64 NOP microbenchmarks, Linus Torvalds, (Wed Aug 13, 2:27 pm)
Re: Efficient x86 and x86_64 NOP microbenchmarks, Mathieu Desnoyers, (Wed Aug 13, 3:16 pm)
Re: Efficient x86 and x86_64 NOP microbenchmarks, Andi Kleen, (Wed Aug 13, 2:41 pm)
Re: Efficient x86 and x86_64 NOP microbenchmarks, Mathieu Desnoyers, (Wed Aug 13, 3:30 pm)
Re: Efficient x86 and x86_64 NOP microbenchmarks, Andi Kleen, (Wed Aug 13, 3:37 pm)
Re: Efficient x86 and x86_64 NOP microbenchmarks, Steven Rostedt, (Fri Aug 15, 5:34 pm)
Re: Efficient x86 and x86_64 NOP microbenchmarks, Andi Kleen, (Fri Aug 15, 5:51 pm)
Re: Efficient x86 and x86_64 NOP microbenchmarks, Mathieu Desnoyers, (Wed Aug 13, 4:01 pm)
[RFC PATCH] x86 alternatives : fix LOCK_PREFIX race with pre..., Mathieu Desnoyers, (Wed Aug 13, 7:41 pm)
Re: [RFC PATCH] x86 alternatives : fix LOCK_PREFIX race with..., Jeremy Fitzhardinge, (Wed Aug 13, 9:22 pm)
Re: [RFC PATCH] x86 alternatives : fix LOCK_PREFIX race with..., Mathieu Desnoyers, (Wed Aug 13, 9:49 pm)
Re: [RFC PATCH] x86 alternatives : fix LOCK_PREFIX race with..., Jeremy Fitzhardinge, (Wed Aug 13, 11:35 pm)
Re: [RFC PATCH] x86 alternatives : fix LOCK_PREFIX race with..., Mathieu Desnoyers, (Thu Aug 14, 11:18 am)
Re: [RFC PATCH] x86 alternatives : fix LOCK_PREFIX race with..., Jeremy Fitzhardinge, (Thu Aug 14, 1:04 pm)
Re: [RFC PATCH] x86 alternatives : fix LOCK_PREFIX race with..., Mathieu Desnoyers, (Thu Aug 14, 1:46 pm)
Re: [RFC PATCH] x86 alternatives : fix LOCK_PREFIX race with..., Jeremy Fitzhardinge, (Thu Aug 14, 1:49 pm)
Re: [RFC PATCH] x86 alternatives : fix LOCK_PREFIX race with..., Mathieu Desnoyers, (Thu Aug 14, 1:55 pm)
Re: [RFC PATCH] x86 alternatives : fix LOCK_PREFIX race with..., Jeremy Fitzhardinge, (Thu Aug 14, 1:28 pm)
Re: [RFC PATCH] x86 alternatives : fix LOCK_PREFIX race with..., Mathieu Desnoyers, (Thu Aug 14, 12:58 pm)
Re: [RFC PATCH] x86 alternatives : fix LOCK_PREFIX race with..., Mathieu Desnoyers, (Thu Aug 14, 3:49 pm)
Re: [RFC PATCH] x86 alternatives : fix LOCK_PREFIX race with..., Mathieu Desnoyers, (Thu Aug 14, 2:09 pm)
Re: [RFC PATCH] x86 alternatives : fix LOCK_PREFIX race with..., Jeremy Fitzhardinge, (Thu Aug 14, 1:05 pm)
Re: [RFC PATCH] x86 alternatives : fix LOCK_PREFIX race with..., Mathieu Desnoyers, (Thu Aug 14, 1:30 pm)
Re: [RFC PATCH] x86 alternatives : fix LOCK_PREFIX race with..., Jeremy Fitzhardinge, (Thu Aug 14, 1:43 pm)
Re: [RFC PATCH] x86 alternatives : fix LOCK_PREFIX race with..., Mathieu Desnoyers, (Thu Aug 14, 2:53 pm)
Re: [RFC PATCH] x86 alternatives : fix LOCK_PREFIX race with..., Jeremy Fitzhardinge, (Thu Aug 14, 3:29 pm)
Re: [RFC PATCH] x86 alternatives : fix LOCK_PREFIX race with..., Mathieu Desnoyers, (Thu Aug 14, 4:31 pm)
Re: [RFC PATCH] x86 alternatives : fix LOCK_PREFIX race with..., Jeremy Fitzhardinge, (Thu Aug 14, 5:46 pm)
Re: [RFC PATCH] x86 alternatives : fix LOCK_PREFIX race with..., Linus Torvalds, (Thu Aug 14, 12:10 pm)
Re: [RFC PATCH] x86 alternatives : fix LOCK_PREFIX race with..., Mathieu Desnoyers, (Wed Aug 13, 9:13 pm)
Re: Efficient x86 and x86_64 NOP microbenchmarks, Avi Kivity, (Wed Aug 13, 2:45 pm)
Re: Efficient x86 and x86_64 NOP microbenchmarks, Andi Kleen, (Wed Aug 13, 2:51 pm)
Re: Efficient x86 and x86_64 NOP microbenchmarks, Avi Kivity, (Wed Aug 13, 2:56 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Mathieu Desnoyers, (Wed Aug 13, 2:31 am)
Re: [PATCH 0/5] ftrace: to kill a daemon, Mathieu Desnoyers, (Wed Aug 13, 11:38 am)
Re: [PATCH 0/5] ftrace: to kill a daemon, Steven Rostedt, (Fri Aug 8, 8:51 pm)
Re: [PATCH 0/5] ftrace: to kill a daemon, Peter Zijlstra, (Fri Aug 8, 2:15 pm)