xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0 of 2] x86/mm: Switch paging/sharing/access per-page ops to memops
@ 2012-02-01 20:09 Andres Lagar-Cavilla
  2012-02-01 20:09 ` [PATCH 1 of 2] Use memops for mem paging, sharing, and access, instead of domctls Andres Lagar-Cavilla
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Andres Lagar-Cavilla @ 2012-02-01 20:09 UTC (permalink / raw)
  To: xen-devel
  Cc: ian.campbell, andres, tim, keir.xen, JBeulich, ian.jackson, adin

Per page operations in the paging, sharing, and access tracking subsystems are
all implemented with domctls (e.g. a domctl to evict one page, or to share one
page).

Under heavy load, the domctl path reveals a lack of scalability. The domctl
lock serializes dom0's vcpus in the hypervisor. When performing thousands of
per-page operations on dozens of domains, these vcpus will spin in the
hypervisor. Beyond the aggressive locking, an added inefficiency of blocking
vcpus in the domctl lock is that dom0 is prevented from re-scheduling any of
its other work-starved processes.

We retain the domctl interface for setting up and tearing down
paging/sharing/mem access for a domain. But we migrate all the per page
operations to use the memory_op hypercalls (e.g XENMEM_*).

A new tools-only section is added to the public memory.h header.

This is a backwards-incompatible ABI change. It's been floating on the list for
a couple weeks now, with no nacks thus far.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla>
Signed-off-by: Adin Scannell <adin@scannell.ca>

 tools/libxc/xc_mem_access.c          |   12 +-
 tools/libxc/xc_mem_event.c           |   23 +++-
 tools/libxc/xc_mem_paging.c          |   44 ++++----
 tools/libxc/xc_memshr.c              |  182 ++++++++++++++++------------------
 tools/libxc/xenctrl.h                |    6 +-
 tools/memshr/interface.c             |    4 +-
 tools/tests/mem-sharing/memshrtool.c |    4 +-
 xen/arch/x86/domctl.c                |    1 -
 xen/arch/x86/mm/mem_access.c         |    7 +-
 xen/arch/x86/mm/mem_event.c          |   68 ++++++++++--
 xen/arch/x86/mm/mem_paging.c         |   13 +-
 xen/arch/x86/mm/mem_sharing.c        |   99 +++++++++++-------
 xen/arch/x86/x86_64/compat/mm.c      |   23 ++++
 xen/arch/x86/x86_64/mm.c             |   23 ++++
 xen/include/asm-x86/mem_access.h     |    3 +-
 xen/include/asm-x86/mem_event.h      |    2 +
 xen/include/asm-x86/mem_paging.h     |    3 +-
 xen/include/asm-x86/mem_sharing.h    |    3 +
 xen/include/public/domctl.h          |   90 +++-------------
 xen/include/public/memory.h          |   87 ++++++++++++++++
 tools/libxc/xc_memshr.c              |   11 ++
 tools/libxc/xenctrl.h                |    1 +
 tools/tests/mem-sharing/memshrtool.c |   11 ++
 xen/arch/x86/mm/mem_sharing.c        |   13 +-
 xen/arch/x86/x86_64/compat/mm.c      |    3 +
 xen/arch/x86/x86_64/mm.c             |    2 +
 xen/include/asm-x86/mem_sharing.h    |    3 +-
 xen/include/public/memory.h          |    1 +
 28 files changed, 458 insertions(+), 284 deletions(-)

^ permalink raw reply	[flat|nested] 12+ messages in thread
* [PATCH 0 of 2] RFC Switch mem event ABI from domctl to memops
@ 2012-01-26 13:08 Andres Lagar-Cavilla
  2012-01-26 13:08 ` [PATCH 1 of 2] Use memops for mem paging, sharing, and access, instead of domctls Andres Lagar-Cavilla
  0 siblings, 1 reply; 12+ messages in thread
From: Andres Lagar-Cavilla @ 2012-01-26 13:08 UTC (permalink / raw)
  To: xen-devel; +Cc: ian.campbell, andres, tim, olaf, keir.xen, ian.jackson, adin

Swith mem event per page operations from domctl to XENMEM_* interface. Improve
scalabilty.

Looking for further feedback on the proposed ABI change.

This code has been tested to work generally well, save for a few blue screens.
It might be that removing the global domctl lock uncovers hidden races.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Adin Scannell <adin@scannell.ca>

 tools/libxc/xc_mem_access.c          |   12 +-
 tools/libxc/xc_mem_event.c           |   23 +++-
 tools/libxc/xc_mem_paging.c          |   44 ++++----
 tools/libxc/xc_memshr.c              |  182 ++++++++++++++++------------------
 tools/libxc/xenctrl.h                |    6 +-
 tools/memshr/interface.c             |    4 +-
 tools/tests/mem-sharing/memshrtool.c |    4 +-
 xen/arch/x86/domctl.c                |    1 -
 xen/arch/x86/mm/mem_access.c         |    7 +-
 xen/arch/x86/mm/mem_event.c          |   68 ++++++++++--
 xen/arch/x86/mm/mem_paging.c         |   13 +-
 xen/arch/x86/mm/mem_sharing.c        |  101 +++++++++++-------
 xen/arch/x86/x86_64/compat/mm.c      |   23 ++++
 xen/arch/x86/x86_64/mm.c             |   23 ++++
 xen/include/asm-x86/mem_access.h     |    3 +-
 xen/include/asm-x86/mem_event.h      |    2 +
 xen/include/asm-x86/mem_paging.h     |    3 +-
 xen/include/asm-x86/mem_sharing.h    |    3 +
 xen/include/public/domctl.h          |   90 +++-------------
 xen/include/public/memory.h          |   87 ++++++++++++++++
 tools/libxc/xc_memshr.c              |   11 ++
 tools/libxc/xenctrl.h                |    1 +
 tools/tests/mem-sharing/memshrtool.c |   11 ++
 xen/arch/x86/mm/mem_sharing.c        |   13 +-
 xen/arch/x86/x86_64/compat/mm.c      |    3 +
 xen/arch/x86/x86_64/mm.c             |    2 +
 xen/include/asm-x86/mem_sharing.h    |    3 +-
 xen/include/public/memory.h          |    1 +
 28 files changed, 460 insertions(+), 284 deletions(-)

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2012-02-03  8:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-01 20:09 [PATCH 0 of 2] x86/mm: Switch paging/sharing/access per-page ops to memops Andres Lagar-Cavilla
2012-02-01 20:09 ` [PATCH 1 of 2] Use memops for mem paging, sharing, and access, instead of domctls Andres Lagar-Cavilla
2012-02-02 12:56   ` Ian Campbell
2012-02-02 14:25     ` Andres Lagar-Cavilla
2012-02-02 14:58       ` Ian Campbell
2012-02-02 20:23         ` Andres Lagar-Cavilla
2012-02-02 20:25           ` Ian Campbell
2012-02-02 23:09             ` Andres Lagar-Cavilla
2012-02-03  8:40               ` Ian Campbell
2012-02-01 20:09 ` [PATCH 2 of 2] x86/mm: New sharing audit memop Andres Lagar-Cavilla
2012-02-02 12:54 ` [PATCH 0 of 2] x86/mm: Switch paging/sharing/access per-page ops to memops Tim Deegan
  -- strict thread matches above, loose matches on Subject: below --
2012-01-26 13:08 [PATCH 0 of 2] RFC Switch mem event ABI from domctl " Andres Lagar-Cavilla
2012-01-26 13:08 ` [PATCH 1 of 2] Use memops for mem paging, sharing, and access, instead of domctls Andres Lagar-Cavilla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).