<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/x86/kernel/Makefile, branch linux-2.6.30.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.30.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.30.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2009-05-15T18:07:42Z</updated>
<entry>
<title>x86: Fix performance regression caused by paravirt_ops on native kernels</title>
<updated>2009-05-15T18:07:42Z</updated>
<author>
<name>Jeremy Fitzhardinge</name>
</author>
<published>2009-05-14T00:16:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b4ecc126991b30fe5f9a59dfacda046aeac124b2'/>
<id>urn:sha1:b4ecc126991b30fe5f9a59dfacda046aeac124b2</id>
<content type='text'>
Xiaohui Xin and some other folks at Intel have been looking into what's
behind the performance hit of paravirt_ops when running native.

It appears that the hit is entirely due to the paravirtualized
spinlocks introduced by:

 | commit 8efcbab674de2bee45a2e4cdf97de16b8e609ac8
 | Date:   Mon Jul 7 12:07:51 2008 -0700
 |
 |     paravirt: introduce a "lock-byte" spinlock implementation

The extra call/return in the spinlock path is somehow
causing an increase in the cycles/instruction of somewhere around 2-7%
(seems to vary quite a lot from test to test).  The working theory is
that the CPU's pipeline is getting upset about the
call-&gt;call-&gt;locked-op-&gt;return-&gt;return, and seems to be failing to
speculate (though I haven't seen anything definitive about the precise
reasons).  This doesn't entirely make sense, because the performance
hit is also visible on unlock and other operations which don't involve
locked instructions.  But spinlock operations clearly swamp all the
other pvops operations, even though I can't imagine that they're
nearly as common (there's only a .05% increase in instructions
executed).

If I disable just the pv-spinlock calls, my tests show that pvops is
identical to non-pvops performance on native (my measurements show that
it is actually about .1% faster, but Xiaohui shows a .05% slowdown).

Summary of results, averaging 10 runs of the "mmperf" test, using a
no-pvops build as baseline:

		nopv		Pv-nospin	Pv-spin
CPU cycles	100.00%		99.89%		102.18%
instructions	100.00%		100.10%		100.15%
CPI		100.00%		99.79%		102.03%
cache ref	100.00%		100.84%		100.28%
cache miss	100.00%		90.47%		88.56%
cache miss rate	100.00%		89.72%		88.31%
branches	100.00%		99.93%		100.04%
branch miss	100.00%		103.66%		107.72%
branch miss rt	100.00%		103.73%		107.67%
wallclock	100.00%		99.90%		102.20%

The clear effect here is that the 2% increase in CPI is
directly reflected in the final wallclock time.

(The other interesting effect is that the more ops are
out of line calls via pvops, the lower the cache access
and miss rates.  Not too surprising, but it suggests that
the non-pvops kernel is over-inlined.  On the flipside,
the branch misses go up correspondingly...)

So, what's the fix?

Paravirt patching turns all the pvops calls into direct calls, so
_spin_lock etc do end up having direct calls.  For example, the compiler
generated code for paravirtualized _spin_lock is:

&lt;_spin_lock+0&gt;:		mov    %gs:0xb4c8,%rax
&lt;_spin_lock+9&gt;:		incl   0xffffffffffffe044(%rax)
&lt;_spin_lock+15&gt;:	callq  *0xffffffff805a5b30
&lt;_spin_lock+22&gt;:	retq

The indirect call will get patched to:
&lt;_spin_lock+0&gt;:		mov    %gs:0xb4c8,%rax
&lt;_spin_lock+9&gt;:		incl   0xffffffffffffe044(%rax)
&lt;_spin_lock+15&gt;:	callq &lt;__ticket_spin_lock&gt;
&lt;_spin_lock+20&gt;:	nop; nop		/* or whatever 2-byte nop */
&lt;_spin_lock+22&gt;:	retq

One possibility is to inline _spin_lock, etc, when building an
optimised kernel (ie, when there's no spinlock/preempt
instrumentation/debugging enabled).  That will remove the outer
call/return pair, returning the instruction stream to a single
call/return, which will presumably execute the same as the non-pvops
case.  The downsides arel 1) it will replicate the
preempt_disable/enable code at eack lock/unlock callsite; this code is
fairly small, but not nothing; and 2) the spinlock definitions are
already a very heavily tangled mass of #ifdefs and other preprocessor
magic, and making any changes will be non-trivial.

The other obvious answer is to disable pv-spinlocks.  Making them a
separate config option is fairly easy, and it would be trivial to
enable them only when Xen is enabled (as the only non-default user).
But it doesn't really address the common case of a distro build which
is going to have Xen support enabled, and leaves the open question of
whether the native performance cost of pv-spinlocks is worth the
performance improvement on a loaded Xen system (10% saving of overall
system CPU when guests block rather than spin).  Still it is a
reasonable short-term workaround.

[ Impact: fix pvops performance regression when running native ]

Analysed-by: "Xin Xiaohui" &lt;xiaohui.xin@intel.com&gt;
Analysed-by: "Li Xin" &lt;xin.li@intel.com&gt;
Analysed-by: "Nakajima Jun" &lt;jun.nakajima@intel.com&gt;
Signed-off-by: Jeremy Fitzhardinge &lt;jeremy.fitzhardinge@citrix.com&gt;
Acked-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Nick Piggin &lt;npiggin@suse.de&gt;
Cc: Xen-devel &lt;xen-devel@lists.xensource.com&gt;
LKML-Reference: &lt;4A0B62F7.5030802@goop.org&gt;
[ fixed the help text ]
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>Merge branch 'tracing/core-v2' into tracing-for-linus</title>
<updated>2009-04-01T22:49:02Z</updated>
<author>
<name>Ingo Molnar</name>
</author>
<published>2009-04-01T19:54:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8302294f43250dc337108c51882a6007f2b1e2e0'/>
<id>urn:sha1:8302294f43250dc337108c51882a6007f2b1e2e0</id>
<content type='text'>
Conflicts:
	include/linux/slub_def.h
	lib/Kconfig.debug
	mm/slob.c
	mm/slub.c
</content>
</entry>
<entry>
<title>Merge branch 'iommu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip</title>
<updated>2009-03-30T20:41:00Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2009-03-30T20:41:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=712b0006bf3a9ed0b14a56c3291975e582127766'/>
<id>urn:sha1:712b0006bf3a9ed0b14a56c3291975e582127766</id>
<content type='text'>
* 'iommu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (60 commits)
  dma-debug: make memory range checks more consistent
  dma-debug: warn of unmapping an invalid dma address
  dma-debug: fix dma_debug_add_bus() definition for !CONFIG_DMA_API_DEBUG
  dma-debug/x86: register pci bus for dma-debug leak detection
  dma-debug: add a check dma memory leaks
  dma-debug: add checks for kernel text and rodata
  dma-debug: print stacktrace of mapping path on unmap error
  dma-debug: Documentation update
  dma-debug: x86 architecture bindings
  dma-debug: add function to dump dma mappings
  dma-debug: add checks for sync_single_sg_*
  dma-debug: add checks for sync_single_range_*
  dma-debug: add checks for sync_single_*
  dma-debug: add checking for [alloc|free]_coherent
  dma-debug: add add checking for map/unmap_sg
  dma-debug: add checking for map/unmap_page/single
  dma-debug: add core checking functions
  dma-debug: add debugfs interface
  dma-debug: add kernel command line parameters
  dma-debug: add initialization code
  ...

Fix trivial conflicts due to whitespace changes in arch/x86/kernel/pci-nommu.c
</content>
</entry>
<entry>
<title>Merge branch 'linus' into core/iommu</title>
<updated>2009-03-28T22:05:50Z</updated>
<author>
<name>Ingo Molnar</name>
</author>
<published>2009-03-28T22:05:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b0d44c0dbbd52effb731b1c0af9afd56215c48de'/>
<id>urn:sha1:b0d44c0dbbd52effb731b1c0af9afd56215c48de</id>
<content type='text'>
Conflicts:
	arch/x86/Kconfig
</content>
</entry>
<entry>
<title>Revert "x86: don't compile vsmp_64 for 32bit"</title>
<updated>2009-03-25T20:34:28Z</updated>
<author>
<name>Ravikiran G Thirumalai</name>
</author>
<published>2009-03-24T06:14:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=70511134f61bd6e5eed19f767381f9fb3e762d49'/>
<id>urn:sha1:70511134f61bd6e5eed19f767381f9fb3e762d49</id>
<content type='text'>
Partial revert of commit 129d8bc828e011bda0b7110a097bf3a0167f966e
titled 'x86: don't compile vsmp_64 for 32bit'

Commit reverted to compile vsmp_64.c if CONFIG_X86_64 is defined,
since is_vsmp_box() needs to indicate that TSCs are not synchronized, and
hence, not a valid time source, even when CONFIG_X86_VSMP is not defined.

Signed-off-by: Ravikiran Thirumalai &lt;kiran@scalex86.org&gt;
Cc: Yinghai Lu &lt;yinghai@kernel.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: shai@scalex86.org
LKML-Reference: &lt;20090324061429.GH7278@localdomain&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing/syscalls: support for syscalls tracing on x86, fix</title>
<updated>2009-03-13T16:02:17Z</updated>
<author>
<name>Ingo Molnar</name>
</author>
<published>2009-03-13T16:02:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ccd50dfd92ea2c4ba9e39531ac55db53393e783e'/>
<id>urn:sha1:ccd50dfd92ea2c4ba9e39531ac55db53393e783e</id>
<content type='text'>
Impact: build fix

 kernel/built-in.o: In function `ftrace_syscall_exit':
 (.text+0x76667): undefined reference to `syscall_nr_to_meta'

ftrace.o is built:

obj-$(CONFIG_DYNAMIC_FTRACE)    += ftrace.o
obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o

But now a CONFIG_FTRACE_SYSCALLS dependency is needed too.

Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
LKML-Reference: &lt;1236401580-5758-3-git-send-email-fweisbec@gmail.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>x86: UV, SGI RTC: add UV RTC clocksource/clockevents</title>
<updated>2009-03-04T19:25:38Z</updated>
<author>
<name>Dimitri Sivanich</name>
</author>
<published>2009-03-04T18:59:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5ab5ab34498f94d60884c4ccea890601e429042e'/>
<id>urn:sha1:5ab5ab34498f94d60884c4ccea890601e429042e</id>
<content type='text'>
This patch provides a high resolution clock/timer source using the
SGI UV system-wide synchronized RTC clock/timer hardware.

Signed-off-by: Dimitri Sivanich &lt;sivanich@sgi.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: john stultz &lt;johnstul@us.ibm.com&gt;
LKML-Reference: &lt;20090304185918.GC24419@sgi.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>x86: don't compile vsmp_64 for 32bit</title>
<updated>2009-02-26T05:40:06Z</updated>
<author>
<name>Yinghai Lu</name>
</author>
<published>2009-02-26T05:20:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=129d8bc828e011bda0b7110a097bf3a0167f966e'/>
<id>urn:sha1:129d8bc828e011bda0b7110a097bf3a0167f966e</id>
<content type='text'>
Impact: cleanup

that is only needed when CONFIG_X86_VSMP is defined with 64bit
also remove dead code about PCI, because CONFIG_X86_VSMP depends on PCI

Signed-off-by: Yinghai Lu &lt;yinghai@kernel.org&gt;
Cc: Ravikiran Thirumalai &lt;kiran@scalex86.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>x86, apic: separate 32-bit setup functionality out of apic_32.c</title>
<updated>2009-02-17T22:12:48Z</updated>
<author>
<name>Ingo Molnar</name>
</author>
<published>2009-02-17T22:12:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9be1b56a3e718aa998772019c57c398dbb19e258'/>
<id>urn:sha1:9be1b56a3e718aa998772019c57c398dbb19e258</id>
<content type='text'>
Impact: build fix, cleanup

A couple of arch setup callbacks were mistakenly in apic_32.c, breaking
the build.

Also simplify the code a bit.

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>x86, apic: move remaining APIC drivers to arch/x86/kernel/apic/*</title>
<updated>2009-02-17T19:35:47Z</updated>
<author>
<name>Ingo Molnar</name>
</author>
<published>2009-02-17T19:35:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2a05180fe2e5b414f0cb2ccfc80e6c90563e3c67'/>
<id>urn:sha1:2a05180fe2e5b414f0cb2ccfc80e6c90563e3c67</id>
<content type='text'>
Move the 32-bit extended-arch APIC drivers to arch/x86/kernel/apic/
too, and rename apic_64.c to probe_64.c.

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
</feed>
