From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751778AbdBOFh0 (ORCPT ); Wed, 15 Feb 2017 00:37:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49062 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750762AbdBOFhY (ORCPT ); Wed, 15 Feb 2017 00:37:24 -0500 Subject: Re: [PATCH V2] vhost: introduce O(1) vq metadata cache To: mst@redhat.com, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <1481709237-19827-1-git-send-email-jasowang@redhat.com> Cc: wexu@redhat.com, peterx@redhat.com, vkaplans@redhat.com, maxime.coquelin@redhat.com From: Jason Wang Message-ID: Date: Wed, 15 Feb 2017 13:37:17 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <1481709237-19827-1-git-send-email-jasowang@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 15 Feb 2017 05:37:25 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2016年12月14日 17:53, Jason Wang wrote: > When device IOTLB is enabled, all address translations were stored in > interval tree. O(lgN) searching time could be slow for virtqueue > metadata (avail, used and descriptors) since they were accessed much > often than other addresses. So this patch introduces an O(1) array > which points to the interval tree nodes that store the translations of > vq metadata. Those array were update during vq IOTLB prefetching and > were reset during each invalidation and tlb update. Each time we want > to access vq metadata, this small array were queried before interval > tree. This would be sufficient for static mappings but not dynamic > mappings, we could do optimizations on top. > > Test were done with l2fwd in guest (2M hugepage): > > noiommu | before | after > tx 1.32Mpps | 1.06Mpps(82%) | 1.30Mpps(98%) > rx 2.33Mpps | 1.46Mpps(63%) | 2.29Mpps(98%) > > We can almost reach the same performance as noiommu mode. > > Signed-off-by: Jason Wang > --- > Changes from V1: > - silent 32bit build warning ping