From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yongji Xie Subject: [PATCH v2 0/2] KVM: PPC: Book3S HV: Optimize for MMIO emulation Date: Fri, 4 Nov 2016 13:55:10 +0800 Message-ID: <1478238912-30680-1-git-send-email-xyjxie@linux.vnet.ibm.com> Cc: paulus@samba.org, zhong@linux.vnet.ibm.com To: kvm-ppc@vger.kernel.org, kvm@vger.kernel.org Return-path: Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:45126 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933389AbcKDF5t (ORCPT ); Fri, 4 Nov 2016 01:57:49 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uA45rV9i080852 for ; Fri, 4 Nov 2016 01:57:48 -0400 Received: from e35.co.us.ibm.com (e35.co.us.ibm.com [32.97.110.153]) by mx0b-001b2d01.pphosted.com with ESMTP id 26gff7vdgx-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 04 Nov 2016 01:57:48 -0400 Received: from localhost by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 3 Nov 2016 23:57:47 -0600 Sender: kvm-owner@vger.kernel.org List-ID: Today, for each emulated MMIO operation, there is a long path from page fault to kvmppc_hv_emulate_mmio(), include looking up Hash Page Table, locking HPTE twice and searching mmio gfn from memslots. This series introduced a cache mechanism for MMIO HPTEs to shorten the path, which will improve the IO performance of emulated device, especially virtio device. Because currently almost all of virtio nofications(Port IO access) will hit the same HPTE. In this series, patch 1 fixed a bug on key field of HPTE; patch 2 implemented the per vcpu cache for recently page faulted MMIO entries. The performance test result: FIO(null_blk, iops) =========================== Before After 1st 32095 32616 2nd 32032 32635 3rd 32057 32638 4th 32005 32598 5th 32069 32628 NetPerf(TCP_RR, Trans.Rate per sec) =========================== Before After 1st 30734.66 31328.63 2nd 30749.26 31337.77 3rd 30825.99 31278.19 4th 30708.94 31350.81 5th 30832.35 31484.80 Changelog v2: - Fix a bug of the function is_mmio_hpte() - Add some performance test results Yongji Xie (2): KVM: PPC: Book3S HV: Clear the key field of HPTE when the page is paged out KVM: PPC: Book3S HV: Add a per vcpu cache for recently page faulted MMIO entries arch/powerpc/include/asm/kvm_host.h | 21 ++++++ arch/powerpc/kvm/book3s_64_mmu_hv.c | 20 ++++++- arch/powerpc/kvm/book3s_hv.c | 9 +++ arch/powerpc/kvm/book3s_hv_rm_mmu.c | 122 +++++++++++++++++++++++++++++------ 4 files changed, 151 insertions(+), 21 deletions(-)