Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752731AbbBQRJM (ORCPT ); Tue, 17 Feb 2015 12:09:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34543 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752664AbbBQRJK (ORCPT ); Tue, 17 Feb 2015 12:09:10 -0500 Message-ID: <54E375B2.8090101@redhat.com> Date: Tue, 17 Feb 2015 18:09:06 +0100 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Igor Mammedov , "Michael S. Tsirkin" CC: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH] vhost: support upto 509 memory regions References: <1423842599-5174-1-git-send-email-imammedo@redhat.com> <20150217090242.GA20254@redhat.com> <54E31F24.1060705@redhat.com> <20150217123212.GA6362@redhat.com> <54E33E09.5090603@redhat.com> <20150217132931.GB6362@redhat.com> <20150217160240.1085e2f7@nial.brq.redhat.com> In-Reply-To: <20150217160240.1085e2f7@nial.brq.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 917 Lines: 33 On 17/02/2015 16:02, Igor Mammedov wrote: >> > >> > Not if there are about 6 regions, I think. > When memslots where increased to 509 and look up of them was replaced on > binary search results were on par with linear search for a default 13 memslots VM. > > Adding LRU You mean MRU. :) > cache helped to shave ~40% of cycles for sequential lookup workloads. It's a bit different for vhost because you can have up to four "things" being looked up at the same time: - the s/g list that will end up in the skb - the avail/used ring - the virtio buffers - the virtio indirect buffers So you probably need multiple MRU caches. But yes, MRU can help a lot. Paolo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/