Prev: [PATCH v3 6/11] KVM: MMU: introduce gfn_to_pfn_atomic() function
Next: [PATCH v3 1/11] KVM: MMU: fix writable sync sp mapping
From: Peter Zijlstra on 30 Jun 2010 04:10 On Tue, 2010-06-29 at 15:31 +0100, Jan Beulich wrote: > Add optional (alternative instructions based) callout hooks to the > contended ticket lock and the ticket unlock paths, to allow hypervisor > specific code to be used for reducing/eliminating the bad effects > ticket locks have on performance when running virtualized. Uhm, I'd much rather see a single alternative implementation, not a per-hypervisor lock implementation. > For the moment, this isn't intended to be used together with pv-ops, > but this is just to simplify initial integration. The ultimate goal > for this should still be to replace pv-ops spinlocks. So why not start by removing that? > +config ENLIGHTEN_SPINLOCKS Why exactly are these enlightened? I'd say CONFIG_UNFAIR_SPINLOCKS would be much better. > +#define X86_FEATURE_SPINLOCK_YIELD (3*32+31) /* hypervisor yield interface */ That name also sucks chunks, yield isn't a lock related term. > +#define ALTERNATIVE_TICKET_LOCK \ But but but, the alternative isn't a ticket lock..!? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Peter Zijlstra on 30 Jun 2010 05:20 On Wed, 2010-06-30 at 10:00 +0100, Jan Beulich wrote: > >>> On 30.06.10 at 10:05, Peter Zijlstra <peterz(a)infradead.org> wrote: > > On Tue, 2010-06-29 at 15:31 +0100, Jan Beulich wrote: > >> Add optional (alternative instructions based) callout hooks to the > >> contended ticket lock and the ticket unlock paths, to allow hypervisor > >> specific code to be used for reducing/eliminating the bad effects > >> ticket locks have on performance when running virtualized. > > > > Uhm, I'd much rather see a single alternative implementation, not a > > per-hypervisor lock implementation. > > How would you imaging this to work? I can't see how the mechanism > could be hypervisor agnostic. Just look at the Xen implementation > (patch 2) - do you really see room for meaningful abstraction there? I tried not to, it made my eyes bleed.. But from what I hear all virt people are suffering from spinlocks (and fair spinlocks in particular), so I was thinking it'd be a good idea to get all interested parties to collaborate on one. Fragmentation like this hardly ever works out well. > Not the least that not every hypervisor may even have a way to > poll for events (like Xen does), in which case a simple yield may be > needed instead. No idea what you're talking about, I think you assume I actually know something about Xen or virt.. > >> For the moment, this isn't intended to be used together with pv-ops, > >> but this is just to simplify initial integration. The ultimate goal > >> for this should still be to replace pv-ops spinlocks. > > > > So why not start by removing that? > > Because I wouldn't get around to test it within the time constraints > I have? I'd say that removing basically dead code (the paravirt spinlocks) the code you'd be changing was easier to follow and thus your patches would be done quicker? > >> +#define ALTERNATIVE_TICKET_LOCK \ > > > > But but but, the alternative isn't a ticket lock..!? > > ??? Of course it is. Ah, right, after looking a bit more at patch 2 I see you indeed implement a ticket like lock. Although why you need both a ticket and a FIFO list is beyond me. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Peter Zijlstra on 30 Jun 2010 05:30 On Wed, 2010-06-30 at 10:05 +0200, Peter Zijlstra wrote: > > +config ENLIGHTEN_SPINLOCKS > > Why exactly are these enlightened? Or did I just miss a terribly pun: enlightenment -> Buddha -> Zen -> Xen ? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Gleb Natapov on 30 Jun 2010 05:40 On Wed, Jun 30, 2010 at 11:26:36AM +0200, Peter Zijlstra wrote: > On Wed, 2010-06-30 at 10:05 +0200, Peter Zijlstra wrote: > > > +config ENLIGHTEN_SPINLOCKS > > > > Why exactly are these enlightened? > > Or did I just miss a terribly pun: > enlightenment -> Buddha -> Zen -> Xen ? Enlightenment is also a term that MS uses to describe their PV guests which makes this name very confusing in Xen context. When I saw this patch series I thought it has something to do with Hyper-V. -- Gleb. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Peter Zijlstra on 30 Jun 2010 07:50
On Wed, 2010-06-30 at 12:43 +0100, Jan Beulich wrote: > It does tickle just the new owner - that's what the list is for. But if you have a FIFO list you don't need the ticket stuff and can implement a FIFO lock instead. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |