From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH] Using the tlb flush util function where applicable Date: Wed, 17 Sep 2014 12:45:52 +0200 Message-ID: <20140917104551.GA31476@potion.brq.redhat.com> References: <1410556005-15639-1-git-send-email-liangchen.linux@gmail.com> <20140915193351.GA3356@potion.brq.redhat.com> <20140917001524.GA11326@kernel> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Liang Chen , pbonzini@redhat.com, kvm@vger.kernel.org To: Wanpeng Li Return-path: Received: from mx1.redhat.com ([209.132.183.28]:38102 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751564AbaIQKp7 (ORCPT ); Wed, 17 Sep 2014 06:45:59 -0400 Content-Disposition: inline In-Reply-To: <20140917001524.GA11326@kernel> Sender: kvm-owner@vger.kernel.org List-ID: 2014-09-17 08:15+0800, Wanpeng Li: > Hi Radim, > On Mon, Sep 15, 2014 at 09:33:52PM +0200, Radim Kr=C4=8Dm=C3=A1=C5=99= wrote: > >Do you prefer the current behavior? > > > >--- 8< --- > >KVM: x86: count actual tlb flushes > > > >- we count KVM_REQ_TLB_FLUSH requests, not actual flushes >=20 > So there maybe multiple requests accumulated at the point of kvm_chec= k_request,=20 > if your patch account these accumulations correctly? It will ignore request accumulations and count it as one TLB flush, we have to decide what is correct (the value is just statistics) a) count local KVM_REQ_TLB_FLUSH requests b) count all TLB flushes c) both (a) and (b) I was thinking that when you look at /sys/kernel/debug/kvm/tlb_flushes, you are interested in the number of TLB flushes that VMs did, not requests, so you won't have to add remote_tlb_flushes multiplied by maximal vcpu count and guess their amount from this upper bound. And that we don't even care about requests, so (c) is just complication= =2E --- I tried to get an idea about the number of coalesced requests and added a counter called tlb_flush_real, making option (c). After a night of reading virtio-rng (different experiment) on 1 VCPU VM= : # cat /sys/kernel/debug/kvm/{tlb_flush{,_real},remote_tlb_flush} 5927 5206 0