diff options
author | Olaf Hering <olaf@aepfle.de> | 2012-02-20 21:18:44 +0100 |
---|---|---|
committer | Olaf Hering <olaf@aepfle.de> | 2012-02-20 21:18:44 +0100 |
commit | 9245411c958f4c4a1e77e76b2e1fde699a56929e (patch) | |
tree | 3abb796d4b0b4df153d48518f1edb2a410ef3be7 /tools/xenpaging/policy.h | |
parent | 057d014a288437fef4d58379f1aabcc59a99ea57 (diff) | |
download | xen-9245411c958f4c4a1e77e76b2e1fde699a56929e.tar.gz xen-9245411c958f4c4a1e77e76b2e1fde699a56929e.tar.bz2 xen-9245411c958f4c4a1e77e76b2e1fde699a56929e.zip |
xenpaging: use flat index for pagefile and page-in requests
This change is based on an idea by <hongkaixing@huawei.com> and
<bicky.shi@huawei.com>.
Scanning the victims[] array is time consuming with a large number of
target pages. Replace the loop to find the slot in the pagefile which
holds the requested gfn with an index.
Remove the victims array and replace it with a flat array. This array
holds the gfn for a given slot in the pagefile. Adjust all users of the
victims array.
Rename variable in main() from i to slot to clearify the meaning.
Update xenpaging_evict_page() to pass a pointer to xen_pfn_t to
xc_map_foreign_pages().
Update policy_choose_victim() to return either a gfn or INVALID_MFN.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson.citrix.com>
Diffstat (limited to 'tools/xenpaging/policy.h')
-rw-r--r-- | tools/xenpaging/policy.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/xenpaging/policy.h b/tools/xenpaging/policy.h index 905ee7b209..9bb5558c8f 100644 --- a/tools/xenpaging/policy.h +++ b/tools/xenpaging/policy.h @@ -29,7 +29,7 @@ int policy_init(struct xenpaging *paging); -int policy_choose_victim(struct xenpaging *paging, struct victim *victim); +unsigned long policy_choose_victim(struct xenpaging *paging); void policy_notify_paged_out(unsigned long gfn); void policy_notify_paged_in(unsigned long gfn); void policy_notify_paged_in_nomru(unsigned long gfn); |