Re: Fw: Benchmarking for vhost polling patch

2015-01-17 Thread Razya Ladelsky
> > 
> > Our suggestion would be to use the maximum (a large enough) value,
> > so that vhost is polling 100% of the time.
> >
> > The polling optimization mainly addresses users who want to maximize 
their 
> > performance, even on the expense of wasting cpu cycles. The maximum 
value 
> > will produce the biggest impact on performance.
> 
> *Everyone* is interested in getting maximum performance from
> their systems.
> 

Maybe so, but not everyone is willing to pay the price.
That is also the reason why this optimization should not be enabled by 
default. 

> > However, using the maximum default value will be valuable even for 
users 
> > who care more about the normalized throughput/cpu criteria. Such 
users, 
> > interested in a finer tuning of the polling timeout need to look for 
an 
> > optimal timeout value for their system. The maximum value serves as 
the 
> > upper limit of the range that needs to be searched for such optimal 
> > timeout value.
> 
> Number of users who are going to do this kind of tuning
> can be counted on one hand.
> 

If the optimization is not enabled by default, the default value is almost 
irrelevant, because when users turn on the feature they should understand 
that there's an associated cost and they have to tune their system if they 
want to get the maximum benefit (depending how they define their maximum 
benefit).
The maximum value is a good starting point that will work in most cases 
and can be used to start the tuning. 

> > 
> > > There are some cases where networking stack already
> > > exposes low-level hardware detail to userspace, e.g.
> > > tcp polling configuration. If we can't come up with
> > > a way to abstract hardware, maybe we can at least tie
> > > it to these existing controls rather than introducing
> > > new ones?
> > > 
> > 
> > We've spent time thinking about the possible interfaces that 
> > could be appropriate for such an optimization(including tcp polling).
> > We think that using the ioctl as interface to "configure" the virtual 
> > device/vhost, 
> > in the same manner that e.g. SET_NET_BACKEND is configured, makes a 
lot of 
> > sense, and
> > is consistent with the existing mechanism. 
> > 
> > Thanks,
> > Razya
> 
> guest is giving up it's share of CPU for benefit of vhost, right?
> So maybe exposing this to guest is appropriate, and then
> add e.g. an ethtool interface for guest admin to set this.
> 

The decision making of whether to turn polling on (and with what rate)
should be made by the system administrator, who has a broad view of the 
system and workload, and not by the guest administrator.
Polling should be a tunable parameter from the host side, the guest should 
not be aware of it.
The guest is not necessarily giving up its time. It may be that there's 
just an extra dedicated core or free cpu cycles on a different cpu.
We provide a mechanism and an interface that can be tuned by some other 
program to implement its policy.
This patch is all about the mechanism and not the policy of how to use it.

Thank you,
Razya 

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 0/3] x86_64,entry: Rearrange the syscall exit optimizations

2015-01-17 Thread Linus Torvalds
On Sat, Jan 17, 2015 at 1:19 PM, Andy Lutomirski  wrote:
> Linus, I suspect you'll either like or hate this series.  Or maybe
> you'll think it's crazy but you'll like it anyway.  I'm curious
> which of those is the case. :)

I have no hugely strong reaction to the patches, but it seems to be a
good simplification of our model, in addition to allowing sysret for
more cases. So Ack, as far as I'm concerned.

   Linus
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH/RFC 14/21] KVM: s390: clear the pfault queue if user space sets the invalid token

2015-01-17 Thread Heiko Carstens
On Thu, Jan 15, 2015 at 02:43:27PM +0100, Christian Borntraeger wrote:
> From: David Hildenbrand 
> 
> We need a way to clear the async pfault queue from user space (e.g.
> for resets and SIGP SET ARCHITECTURE).
> 
> This patch simply clears the queue as soon as user space sets the
> invalid pfault token. The definition of the invalid token is moved
> to uapi.
> 
> Signed-off-by: David Hildenbrand 
> Acked-by: Cornelia Huck 
> Signed-off-by: Christian Borntraeger 
> ---
>  arch/s390/include/asm/kvm_host.h | 1 -
>  arch/s390/include/uapi/asm/kvm.h | 3 +++
>  arch/s390/kvm/kvm-s390.c | 4 
>  3 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/s390/include/asm/kvm_host.h 
> b/arch/s390/include/asm/kvm_host.h
> index 4de479e..b617052 100644
> --- a/arch/s390/include/asm/kvm_host.h
> +++ b/arch/s390/include/asm/kvm_host.h
> @@ -469,7 +469,6 @@ struct kvm_vcpu_arch {
>   };
>   struct gmap *gmap;
>   struct kvm_guestdbg_info_arch guestdbg;
> -#define KVM_S390_PFAULT_TOKEN_INVALID(-1UL)
>   unsigned long pfault_token;
>   unsigned long pfault_select;
>   unsigned long pfault_compare;
> diff --git a/arch/s390/include/uapi/asm/kvm.h 
> b/arch/s390/include/uapi/asm/kvm.h
> index 9c01159..ac3000d 100644
> --- a/arch/s390/include/uapi/asm/kvm.h
> +++ b/arch/s390/include/uapi/asm/kvm.h
> @@ -108,6 +108,9 @@ struct kvm_guest_debug_arch {
>   struct kvm_hw_breakpoint __user *hw_bp;
>  };
>  
> +/* for KVM_SYNC_PFAULT and KVM_REG_S390_PFTOKEN */
> +#define KVM_S390_PFAULT_TOKEN_INVALID0xUL

uapi is for both 64 bit and (theoretically) also 32 bit. So this
should be 0xfff...ffULL instead of UL to prevent a different compat
ABI.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html