1. 14 May, 2012 1 commit
  2. 11 Apr, 2012 1 commit
  3. 30 Mar, 2012 1 commit
  4. 08 Mar, 2012 3 commits
  5. 01 Mar, 2012 1 commit
    • Olaf Hering's avatar
      xenpaging: remove obsolete XENMEM_paging_op_resume · 3c3c513e
      Olaf Hering authored
      With changeset 24364:0964341efd65 an event channel based notification of
      new responses in the ringbuffer is implemented. This makes the memevent
      interface obsolete. Currently a call to p2m_mem_paging_resume() is
      triggered twice by xenpaging, once per memevent and once per even
      channel. In practice this double call does not lead to issues because
      p2m_mem_paging_resume() processes only available events.
      
      xenpaging used the event channel notification since the beginning, but
      it was a no-op until changeset mentioned above. This change removes the
      unneeded XENMEM_paging_op_resume functionality. Pagers are notified via
      an event channel of new requests, and now they are required to notify
      the hypervisor about their responses also with an event channel.
      Signed-off-by: default avatarOlaf Hering <olaf@aepfle.de>
      Acked-by: default avatarTim Deegan <tim@xen.org>
      Acked-by: default avatarIan Jackson <ian.jackson@eu.citrix.com>
      Committed-by: default avatarIan Jackson <ian.jackson@eu.citrix.com>
      3c3c513e
  6. 20 Feb, 2012 10 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
    • Olaf Hering's avatar
      xenpaging: mmap guest pages read-only · b3694e73
      Olaf Hering authored
      xenpaging does not write to the gfn, so map the gfn to page-out in
      read-only mode.
      Signed-off-by: default avatarOlaf Hering <olaf@aepfle.de>
      Signed-off-by: default avatarIan Jackson <ian.jackson@eu.citrix.com>
      Committed-by: default avatarIan Jackson <ian.jackson@eu.citrix.com>
      b3694e73
  7. 09 Feb, 2012 1 commit
    • Olaf Hering's avatar
      xenpaging: deal with MEM_EVENT_FLAG_EVICT_FAIL request in tools/xenpaging · e73be713
      Olaf Hering authored
      If a page is nominated but not evicted,then dom0 accesses the page,it
      will change the page's p2mt to be p2m_ram_paging_in,and the req.flags
      is MEM_EVENT_FLAG_EVICT_FAIL;so it will fail in p2m_mem_paging_evict()
      because of the p2mt;and paging->num_paged_out will not increase in
      this case;After the paging process is terminated, the p2mt
      p2m_ram_paging_in still remains in p2m table.Once domU accesses the
      nominated page,it will result in BSOD or vm'stuck.
      
      The patch adds the dealing of this request to resume the page before
      xenpaging is ended.
      
      [ This can happen if p2m_mem_paging_populate() was called by a foreign
      domain. In this case MEM_EVENT_FLAG_VCPU_PAUSED is not set and xenpaging
      will not sent a response. And in this case the ring is in an
      inconsistent state anyway, new requests cant be added, I think. - Olaf ]
      Signed-off-by: default avatarhongkaixing <hongkaixing@huawei.com>
      Signed-off-by: default avatarshizhen <bicky.shi@huawei.com>
      Acked-by: default avatarOlaf Hering <olaf@aepfle.de>
      Committed-by: default avatarIan Jackson <ian.jackson@eu.citrix.com>
      e73be713
  8. 27 Jan, 2012 1 commit
  9. 09 Jan, 2012 3 commits
  10. 05 Jan, 2012 1 commit
    • Roger Pau Monne's avatar
      xenpaging: remove _XOPEN_SOURCE · 71402de5
      Roger Pau Monne authored
      The _XOPEN_SOURCE define was breaking the compilation under NetBSD.
      I've removed it becasue it is not necessary.
      
      Error message:
      
      gcc  -O1 -fno-omit-frame-pointer -m64 -g -fno-strict-aliasing
      -std=gnu99 -Wall -Wstrict-prototypes -Wno-unused-value
      -Wdeclaration-after-statement   -D__XEN_TOOLS__ -MMD -MF
      .xenpaging.o.d -fno-optimize-sibling-calls
      -I/root/xen-04102011/tools/xenpaging/../../tools/libxc
      -I/root/xen-04102011/tools/xenpaging/../../tools/include
      -I/root/xen-04102011/tools/xenpaging/../../tools/xenstore
      -I/root/xen-04102011/tools/xenpaging/../../tools/include -Werror
      -Wno-unused -g  -c -o xenpaging.o xenpaging.c  -I/usr/xen42/include
      -I/usr/include
      cc1: warnings being treated as errors
      xenpaging.c: In function 'xenpaging_init':
      xenpaging.c:333: warning: implicit declaration of function 'asprintf'
      Signed-off-by: default avatarRoger Pau Monne <roger.pau@entel.upc.edu>
      Acked-by: default avatarIan Jackson <ian.jackson@eu.citrix.com>
      Committed-by: default avatarIan Jackson <ian.jackson@eu.citrix.com>
      71402de5
  11. 01 Dec, 2011 1 commit
  12. 20 Nov, 2011 16 commits