From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olaf Hering Subject: Re: [PATCH] xenpaging:add a new array to speed up page-in in xenpaging Date: Tue, 10 Jan 2012 18:39:57 +0100 Message-ID: <20120110173956.GA2213@aepfle.de> References: <052727b8165ce6e05002.1325732917@h00166998.china.huawei.com> <20229.60517.106414.825193@mariner.uk.xensource.com> <001301cccc1b$d7ca1470$875e3d50$@com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <001301cccc1b$d7ca1470$875e3d50$@com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Hongkaixing Cc: "'bicky.'" , xen-devel@lists.xensource.com, 'Ian Jackson' List-Id: xen-devel@lists.xenproject.org On Fri, Jan 06, Hongkaixing wrote: > > Why wrap this up in a struct ? > > We want to keep the same style with > > typedef struct xenpaging_victim { > /* the gfn of the page to evict */ > unsigned long gfn; > } xenpaging_victim_t; This dates back to the initial implementation of xenpaging. In my testing I started a guest paused, paged it all out, and paged all back into memory. By monitoring nr_pages I noticed that page-in got slightly slower over time, so your suggestion to use two indexes will speed things up a bit. Looking through xenpaging.c, I think its best to have two flat arrays: unsigned long slot_to_gfn[paging->max_pages]; /* was victims */ int gfn_to_slot[paging->max_pages]; I will prepare a patch to implement this. Olaf