From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751912AbdIUOGf (ORCPT ); Thu, 21 Sep 2017 10:06:35 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:41054 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751864AbdIUOGd (ORCPT ); Thu, 21 Sep 2017 10:06:33 -0400 Date: Thu, 21 Sep 2017 16:06:28 +0200 From: Peter Zijlstra To: Konrad Rzeszutek Wilk Cc: Marcelo Tosatti , mingo@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner Subject: Re: [patch 3/3] x86: kvm guest side support for KVM_HC_RT_PRIO hypercall Message-ID: <20170921140628.zliqlz7mrlqs5pzz@hirez.programming.kicks-ass.net> References: <20170921113835.031375194@redhat.com> <20170921114039.466130276@redhat.com> <20170921133653.GO26248@char.us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170921133653.GO26248@char.us.oracle.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 21, 2017 at 09:36:53AM -0400, Konrad Rzeszutek Wilk wrote: > On Thu, Sep 21, 2017 at 08:38:38AM -0300, Marcelo Tosatti wrote: > > Add hypercalls to spinlock/unlock to set/unset FIFO priority > > for the vcpu, protected by a static branch to avoid performance > > increase in the normal kernels. > > > > Enable option by "kvmfifohc" kernel command line parameter (disabled > > by default). WTF kind of fudge is this? Changelog completely fails to explain the problem this would solve. Why are you doing insane things like this? NAK! > > Index: kvm.fifopriohc-submit/include/linux/spinlock_api_smp.h > > =================================================================== > > --- kvm.fifopriohc-submit.orig/include/linux/spinlock_api_smp.h > > +++ kvm.fifopriohc-submit/include/linux/spinlock_api_smp.h > > @@ -136,11 +136,28 @@ static inline void __raw_spin_lock_bh(ra > > LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); > > } > > > > +#ifdef CONFIG_KVM_GUEST > > +DECLARE_STATIC_KEY_FALSE(kvm_fifo_hc_key); > > +#endif > > + > > static inline void __raw_spin_lock(raw_spinlock_t *lock) > > { > > preempt_disable(); > > + > > +#if defined(CONFIG_KVM_GUEST) && defined(CONFIG_SMP) > > + /* enable FIFO priority */ > > + if (static_branch_unlikely(&kvm_fifo_hc_key)) > > + kvm_hypercall1(KVM_HC_RT_PRIO, 0x1); > > +#endif > > + > > spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); > > LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); > > + > > +#if defined(CONFIG_KVM_GUEST) && defined(CONFIG_SMP) > > + /* disable FIFO priority */ > > + if (static_branch_unlikely(&kvm_fifo_hc_key)) > > + kvm_hypercall1(KVM_HC_RT_PRIO, 0); > > +#endif > > } > > > > #endif /* !CONFIG_GENERIC_LOCKBREAK || CONFIG_DEBUG_LOCK_ALLOC */