From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: Re: [PATCH v2] KVM: x86: count actual tlb flushes Date: Thu, 18 Sep 2014 13:05:31 +0800 Message-ID: <541A681B.1020503@linux.vnet.ibm.com> References: <1410978955-19003-1-git-send-email-liangchen.linux@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, rkrcmar@redhat.com To: Liang Chen , pbonzini@redhat.com Return-path: Received: from e28smtp06.in.ibm.com ([122.248.162.6]:42341 "EHLO e28smtp06.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751244AbaIRFFi (ORCPT ); Thu, 18 Sep 2014 01:05:38 -0400 Received: from /spool/local by e28smtp06.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 18 Sep 2014 10:35:35 +0530 Received: from d28relay02.in.ibm.com (d28relay02.in.ibm.com [9.184.220.59]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id D6B8AE0044 for ; Thu, 18 Sep 2014 10:38:05 +0530 (IST) Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay02.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id s8I55uhB51511500 for ; Thu, 18 Sep 2014 10:35:57 +0530 Received: from d28av04.in.ibm.com (localhost [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s8I55Vwv002177 for ; Thu, 18 Sep 2014 10:35:31 +0530 In-Reply-To: <1410978955-19003-1-git-send-email-liangchen.linux@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On 09/18/2014 02:35 AM, Liang Chen wrote: > - we count KVM_REQ_TLB_FLUSH requests, not actual flushes > (KVM can have multiple requests for one flush) > - flushes from kvm_flush_remote_tlbs aren't counted > - it's easy to make a direct request by mistake > > Solve these by postponing the counting to kvm_check_request(), It's good. > and refactor the code to use kvm_make_request again. Why this refactor is needed? It's really a bad idea using raw-bit-set instead of meaningful name. [ Btw, maybe kvm_mmu_flush_local_tlb is a better name than kvm_mmu_flush_tlb() in the current code. ]