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





On Thu, 14 Aug 2008, Mathieu Desnoyers wrote:

I can't argue about the benefit of using VM CPU pinning to manage
resources because I don't use it myself, but I ran some tests out of
curiosity to find if uncontended locks were that cheap, and it turns out
they aren't.

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: new em problems on HEAD
    ... I have no idea, i see no evidence that its the em driver at fault, do you? ... device = '82573E Intel Corporation 82573E Gigabit Ethernet ... <ACPI PCI bus> on pcib0 ... CPU supports Enhanced Speedstep, ...
    (freebsd-current)
  • Re: AMDs 45nm technology compared against Intels
    ... They didn't want to use SOI, ... Cost was it, and they didn't think they needed what advantage it might give. ... doesn't mean that Intel should have gone with SOI. ... that Intel makes maybe 5 times as many processors as AMD does gives them ...
    (comp.sys.ibm.pc.hardware.chips)
  • Re: Cap and Trade, Great Stuff!
    ... > continue to pollute above specified levels and this will represent a ... This cost will be passed directly to the consumer. ... Time will tell with all these tax ... fault, Bush's fault, it is the fault of career politicians, totally ...
    (rec.sport.golf)
  • Re: VEGAS - Trip Report
    ... tip on a flat amount of money, and not think in terms of 20% of $6. ... I don't think "not being there" when the food ... saw that those OJ's were going to cost 5.00 each after looking at ... Why is the concierge at fault for answering your own questions? ...
    (rec.gambling.poker)
  • Re: Computer
    ... the intel macbooks run noticably hotter and consume more ... acceleration did come in it cost battery life in laptops to add GPU ... Apple needed a roadmap for future laptop CPUs and the PowerPC makers ...
    (rec.photo.digital)