From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: Re: [PATCH 06 of 10] xenpaging: improve performance in policy_choose_victim Date: Tue, 14 Feb 2012 22:08:51 +0100 Message-ID: <20120214210851.GA21988@aepfle.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Mon, Jan 30, Olaf Hering wrote: > +++ b/tools/xenpaging/policy_default.c > @@ -80,33 +80,58 @@ int policy_init(struct xenpaging *paging > unsigned long policy_choose_victim(struct xenpaging *paging) > + > + /* gfn busy */ > + if ( test_bit(current_gfn, bitmap) ) > + continue; > + > + /* gfn already tested */ > + if ( test_bit(current_gfn, bitmap) ) > + continue; > + > + /* gfn found */ > + break; The second one should be "unconsumed" instead of "bitmap", otherwise wraparounds lead to endless loop in caller.. Olaf