All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andres Lagar-Cavilla <andres@lagarcavilla.org>
To: xen-devel@lists.xensource.com
Cc: andres@gridcentric.ca, keir.xen@gmail.com, tim@xen.org,
	JBeulich@suse.com, adin@gridcentric.ca
Subject: [PATCH 8 of 9] x86/mm: New domctl: Perform sharing audit
Date: Fri, 09 Dec 2011 15:22:35 -0500	[thread overview]
Message-ID: <5b9b36648e439bca97b0.1323462155@xdev.gridcentric.ca> (raw)
In-Reply-To: <patchbomb.1323462147@xdev.gridcentric.ca>

 xen/arch/x86/mm/mem_sharing.c |  15 ++++++++++-----
 xen/include/public/domctl.h   |   1 +
 2 files changed, 11 insertions(+), 5 deletions(-)


Sharing audits are heavyweight, so instead of performing them inline,
we make them callable via a domctl.

Signed-off-by: Adin Scannell <adin@scannell.ca>

diff -r 82d9d136bad6 -r 5b9b36648e43 xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -936,7 +936,6 @@ int mem_sharing_unshare_page(struct doma
      * between shr_lock and p2m fine-grained locks in mm-lock. 
      * Callers may walk in here already holding the lock for this gfn */
     shr_lock();
-    mem_sharing_audit();
     mfn = get_gfn(d, gfn, &p2mt);
     
     /* Has someone already unshared it? */
@@ -1218,15 +1217,21 @@ int mem_sharing_domctl(struct domain *d,
         }
         break;
 
+        case XEN_DOMCTL_MEM_EVENT_OP_SHARING_AUDIT:
+        {
+#if MEM_SHARING_AUDIT
+            rc = mem_sharing_audit();
+#else
+            rc = -ENOSYS;
+#endif
+            break;
+        }
+
         default:
             rc = -ENOSYS;
             break;
     }
 
-    shr_lock();
-    mem_sharing_audit();
-    shr_unlock();
-
     return rc;
 }
 
diff -r 82d9d136bad6 -r 5b9b36648e43 xen/include/public/domctl.h
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -772,6 +772,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_mem_e
 #define XEN_DOMCTL_MEM_EVENT_OP_SHARING_DEBUG_MFN      6
 #define XEN_DOMCTL_MEM_EVENT_OP_SHARING_DEBUG_GREF     7
 #define XEN_DOMCTL_MEM_EVENT_OP_SHARING_ADD_PHYSMAP    8
+#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_AUDIT          9
 
 #define XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID  (-10)
 #define XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID  (-9)

  parent reply	other threads:[~2011-12-09 20:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-09 20:22 [PATCH 0 of 9] x86/mm: Memory Sharing Overhaul V2 Andres Lagar-Cavilla
2011-12-09 20:22 ` [PATCH 1 of 9] x86/mm: Code style fixes in mem_sharing.c Andres Lagar-Cavilla
2011-12-09 20:22 ` [PATCH 2 of 9] x86/mm: Eliminate hash table in sharing code as index of shared mfns Andres Lagar-Cavilla
2011-12-09 20:22 ` [PATCH 3 of 9] x86/mm: Update mem sharing interface to (re)allow sharing of grants Andres Lagar-Cavilla
2011-12-09 20:22 ` [PATCH 4 of 9] x86/mm: Check how many mfns are shared, in addition to how many are saved Andres Lagar-Cavilla
2011-12-09 20:22 ` [PATCH 5 of 9] x86/mm: Add per-page locking for memory sharing, when audits are disabled Andres Lagar-Cavilla
2011-12-12  9:29   ` Jan Beulich
2011-12-13  4:29     ` Andres Lagar-Cavilla
2011-12-09 20:22 ` [PATCH 6 of 9] x86/mm: New domctl: add a shared page to the physmap Andres Lagar-Cavilla
2011-12-12  9:32   ` Jan Beulich
2011-12-09 20:22 ` [PATCH 7 of 9] Add the ability to poll stats about shared memory via the console Andres Lagar-Cavilla
2011-12-09 20:22 ` Andres Lagar-Cavilla [this message]
2011-12-12  9:33   ` [PATCH 8 of 9] x86/mm: New domctl: Perform sharing audit Jan Beulich
2011-12-13  4:22     ` Andres Lagar-Cavilla
2011-12-13  7:51       ` Jan Beulich
2011-12-09 20:22 ` [PATCH 9 of 9] x86/mm: use RCU in mem sharing audit list, eliminate global lock completely Andres Lagar-Cavilla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5b9b36648e439bca97b0.1323462155@xdev.gridcentric.ca \
    --to=andres@lagarcavilla.org \
    --cc=JBeulich@suse.com \
    --cc=adin@gridcentric.ca \
    --cc=andres@gridcentric.ca \
    --cc=keir.xen@gmail.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.