aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xenpaging/policy.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix emacs local variable block to use correct C style variable.David Vrabel2013-02-211-1/+1
| | | | | | | The emacs variable to set the C style from a local variable block is c-file-style, not c-set-style. Signed-off-by: David Vrabel <david.vrabel@citrix.com
* xenpaging: use flat index for pagefile and page-in requestsOlaf Hering2012-02-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | 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>
* xenpaging: convert xenpaging_t to struct xenpagingOlaf Hering2012-01-091-2/+2
| | | | | Signed-off-by: Olaf Hering <olaf@aepfle.de> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* xenpaging: convert xenpaging_victim_t to struct victimOlaf Hering2012-01-091-1/+1
| | | | | Signed-off-by: Olaf Hering <olaf@aepfle.de> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* xenpaging: improve policy mru list handlingOlaf Hering2011-11-201-0/+2
| | | | | | | | | | | | | | | | | | | Without this change it is not possible to page-out all guest pages, then trigger a page-in for all pages, and then page-out everything once again. All pages in the mru list can not be paged out because they remain active in the internal bitmap of paged pages. Use the mru list only if the number of paged-out pages is larger than the mru list. If the number is smaller, start to clear the mru list. In case the number of paged-out pages drops to zero the mru list and the internal bitmap will be empty as well. Also add a new interface for dropped pages. If a gfn was dropped there is no need to adjust the mru list because dropping a page is not usage of a page. Signed-off-by: Olaf Hering <olaf@aepfle.de> Committed-by: Ian Jackson <ian.jackson.citrix.com>
* xenpaging: remove domain_id and mfn from struct xenpaging_victimKeir Fraser2011-01-111-4/+3
| | | | | | | | | | | | Remove unused member 'mfn' from struct xenpaging_victim. xenpaging operates on a single guest, so it needs only a single domain_id. Remove domain_id from struct xenpaging_victim and use the one from paging->mem_event where needed. Its not used in the policy. This saves 4MB runtime data with a 1GB pagefile. Signed-off-by: Olaf Hering <olaf@aepfle.de>
* xenpaging: update xch usageOlaf Hering2010-12-141-2/+1
| | | | | | | | Instead of passing xch around, use the handle from xenpaging_t. In the updated functions, use a local xch variable. Signed-off-by: Olaf Hering <olaf@aepfle.de> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* libxc: eliminate static variables, use xentoollog; API changeKeir Fraser2010-05-281-1/+2
| | | | | | | | | | | | | | | | | | | | This patch eliminate the global variables in libxenctrl (used for logging and error reporting). Instead the information which was in the global variables is now in a new xc_interface* opaque structure, which xc_interface open returns instead of the raw file descriptor; furthermore, logging is done via xentoollog. There are three new parameters to xc_interface_open to control the logging, but existing callers can just pass "0" for all three to get the old behaviour. All libxc callers have been adjusted accordingly. Also update QEMU_TAG for corresponding qemu change. Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
* Make Citrix copyright strinsg consistent.Keir Fraser2009-12-181-1/+1
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* User-land tool for memory paging.Keir Fraser2009-12-171-0/+48
This tool will page out the specified number of pages from the specified domain. When a paged out page is accessed, Xen will issue a request and notify the tool over an event channel. The tool will process ther request, page the page in, and notify Xen. The current (default) policy tracks the 1024 most recently paged in pages and will not choose to evict any of those. This is done with the assumption that if a page is accessed, it is likely to be accessed again soon. Signed-off-by: Patrick Colp <Patrick.Colp@citrix.com>