1. 21 Feb, 2012 3 commits
  2. 20 Feb, 2012 9 commits
    • Olaf Hering's avatar
      xenpaging: implement stack of free slots in pagefile · a087628d
      Olaf Hering authored
      Scanning the slot_to_gfn[] array for a free slot is expensive because
      evict_pages() always needs to scan the whole array. Remember the last
      slots freed during page-in requests and reuse them in evict_pages().
      Signed-off-by: default avatarOlaf Hering <olaf@aepfle.de>
      Committed-by: Ian Jackson <ian.jackson.citrix.com>
      a087628d
    • Olaf Hering's avatar
      xenpaging: move page_buffer into struct xenpaging · e148caed
      Olaf Hering authored
      Signed-off-by: default avatarOlaf Hering <olaf@aepfle.de>
      Committed-by: Ian Jackson <ian.jackson.citrix.com>
      e148caed
    • Olaf Hering's avatar
      xenpaging: move pagefile filedescriptor into struct xenpaging · 3a5d6284
      Olaf Hering authored
      Signed-off-by: default avatarOlaf Hering <olaf@aepfle.de>
      Committed-by: Ian Jackson <ian.jackson.citrix.com>
      3a5d6284
    • Olaf Hering's avatar
      xenpaging: unify error handling · 63a225e4
      Olaf Hering authored
      Update functions to return -1 on error, 0 on success.
      Simplify init_page() and make sure errno is assigned.
      Adjust PERROR/ERROR usage, use PERROR early because it overwrites errno.
      Adjust xenpaging_populate_page() to handle gfn as unsigned long.
      
      Update xenpaging exit code handling. xenpaging_teardown cant possible
      fail. Adjust mainloop to indicate possible errors to final exit.
      Signed-off-by: default avatarOlaf Hering <olaf@aepfle.de>
      Committed-by: Ian Jackson <ian.jackson.citrix.com>
      63a225e4
    • Olaf Hering's avatar
      xenpaging: improve performance in policy_choose_victim · 6c767584
      Olaf Hering authored
      policy_choose_victim() is one of the bottlenecks in xenpaging. It is called
      alot to find free bits in the fragmented bitmaps.
      
      Reduce turnaround time by skipping longs with all bits set.
      Adjust wrap detection in loop.
      
      v2:
       - fix copy&paste error, bitmap was tested twice
      Signed-off-by: default avatarOlaf Hering <olaf@aepfle.de>
      Committed-by: Ian Jackson <ian.jackson.citrix.com>
      6c767584
    • Olaf Hering's avatar
      xenpaging: move nominate+evict into single function · c7054f43
      Olaf Hering authored
      Move all code to evict a single gfn into one function. This simplifies
      error handling in caller. The function returns -1 on fatal error, 0 on
      success and 1 if the gfn cant be paged.
      Signed-off-by: default avatarOlaf Hering <olaf@aepfle.de>
      Committed-by: Ian Jackson <ian.jackson.citrix.com>
      c7054f43
    • Olaf Hering's avatar
      xenpaging: reduce number of qemu cache flushes · d3d413f0
      Olaf Hering authored
      Currently the command to flush the qemu cache is called alot if there
      are no more pages to evict. This causes churn in the logfiles, and qemu
      can not release more pages anyway since the last command.
      
      Fix this by remembering the current number of paged-out gfns, if this
      number did not change since the last flush command then sending another
      new flush command will not free any more gfns.
      
      Remove return code from xenpaging_mem_paging_flush_ioemu_cache() since
      errors do not matter, and will be handled elsewhere. Also failure to
      send the flush command is not fatal.
      Signed-off-by: default avatarOlaf Hering <olaf@aepfle.de>
      Committed-by: Ian Jackson <ian.jackson.citrix.com>
      d3d413f0
    • Olaf Hering's avatar
      xenpaging: no poll timeout while page-out is in progress · 2ee002a8
      Olaf Hering authored
      The main loop calls xenpaging_wait_for_event_or_timeout() unconditionally
      before doing any work. This function calls poll() with a timeout of 100ms. As
      a result the page-out process is very slow due to the delay in poll().
      
      Call poll() without timeout so that it returns immediately until the page-out
      is done. Page-out is done when either the policy finds no more pages to
      nominate or when the requested number of pages is reached.
      
      The condition is cleared when a watch event arrives, so that processing the
      new target is not delayed once again by poll().
      
      v2:
      - no poll timeout also when large number of evicts is pending
      Signed-off-by: default avatarOlaf Hering <olaf@aepfle.de>
      Committed-by: Ian Jackson <ian.jackson.citrix.com>
      2ee002a8
    • Olaf Hering's avatar
      xenpaging: use flat index for pagefile and page-in requests · 3bf345e6
      Olaf Hering authored
      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: default avatarOlaf Hering <olaf@aepfle.de>
      Committed-by: Ian Jackson <ian.jackson.citrix.com>
      3bf345e6
  3. 21 Feb, 2012 1 commit
  4. 20 Feb, 2012 17 commits
  5. 19 Jan, 2012 2 commits
  6. 20 Feb, 2012 3 commits
  7. 17 Feb, 2012 2 commits
  8. 16 Feb, 2012 3 commits