[PATCH 0/4, v2] x86: enlightenment for ticket spin locks

From: Jan Beulich
Date: Tue Jun 29 2010 - 10:30:08 EST

With the pv-ops based spinlocks reportedly having measurable overhead
on native execution, and with them also not easily fit (at least) fully
virtualized Xen guests, this patch series introduces a replacement
mechanism based on alternative instruction patching, and then uses it
for fully virtualized Xen guests. While coded to be orthogonal to
pv-ops, it really isn't, and it shouldn't be difficult to make pv-ops guests
use this in place of pv-ops spin locks.

The only additional overhead this introduces for native execution is
(in the optional fourth patch) the writing of the owning CPU in the
lock acquire paths. If this is considered a problem but the patch
otherwise is deemed useful, even that code could be eliminated for
native execution (by further alternative instruction patching).

(1) base implementation
(2) Xen implementation
(3) [optional] eliminate NOPs in unlock path (introduced in (1))
(4) [optional] improve behavior on Xen by yielding earlier in
certain cases

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
Cc: KY Srinivasan <ksrinivasan@xxxxxxxxxx>

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/