lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 22 Feb 2011 07:54:41 -0700
From:	Alex Williamson <alex.williamson@...hat.com>
To:	Avi Kivity <avi@...hat.com>
Cc:	Xiao Guangrong <xiaoguangrong@...fujitsu.com>,
	Marcelo Tosatti <mtosatti@...hat.com>,
	LKML <linux-kernel@...r.kernel.org>, KVM <kvm@...r.kernel.org>
Subject: Re: [PATCH 4/7] KVM: sort memslots and use binary search to search
 the right slot

On Tue, 2011-02-22 at 16:25 +0200, Avi Kivity wrote:
> On 02/22/2011 10:12 AM, Xiao Guangrong wrote:
> > Sort memslots then search the slot with binary search to speed up the
> > slot searching
> >
> 
> I'm not sure if a binary search is the right algorithm here.  It 
> introduces a lot of branches which may be mispredicted.
> 
> Options we've discussed are:
> 
> - Sort slots by size, use linear search (so the largest slots are found 
> quickly)
> - Weighted balanced tree 
> http://en.wikipedia.org/wiki/Weight-balanced_tree, use weight == slot size

I've got an implementation using a weight balanced tree working now.  I
need to do some testing to see if I can detect any performance
difference from the current unsorted, linear array.

> Both options still make the miss case (mmio) slow.  We could cache the 
> result of a miss in an spte by using a reserved bit, and checking the 
> page fault error code (or seeing if we get an ept violation or ept 
> misconfiguration), so if we get repeated mmio on a page, we don't need 
> to search the slot list/tree.

I haven't started on this idea yet.  Thanks,

Alex



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ