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 7 of 9] Add the ability to poll stats about shared memory via the console
Date: Fri, 09 Dec 2011 15:22:34 -0500 [thread overview]
Message-ID: <82d9d136bad68b0342cb.1323462154@xdev.gridcentric.ca> (raw)
In-Reply-To: <patchbomb.1323462147@xdev.gridcentric.ca>
xen/arch/ia64/xen/mm.c | 6 ++++++
xen/arch/x86/mm/mem_sharing.c | 8 ++++++++
xen/common/keyhandler.c | 7 +++++--
xen/include/xen/mm.h | 3 +++
4 files changed, 22 insertions(+), 2 deletions(-)
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
diff -r bba44de8394a -r 82d9d136bad6 xen/arch/ia64/xen/mm.c
--- a/xen/arch/ia64/xen/mm.c
+++ b/xen/arch/ia64/xen/mm.c
@@ -3565,6 +3565,12 @@ p2m_pod_decrease_reservation(struct doma
return 0;
}
+/* Simple no-op */
+void arch_dump_shared_mem_info(void)
+{
+ printk("Shared memory not supported yet\n");
+}
+
/*
* Local variables:
* mode: C
diff -r bba44de8394a -r 82d9d136bad6 xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c
+++ b/xen/arch/x86/mm/mem_sharing.c
@@ -1230,6 +1230,14 @@ int mem_sharing_domctl(struct domain *d,
return rc;
}
+void arch_dump_shared_mem_info(void)
+{
+ printk("Shared pages %u -- Saved frames %u -- Dom CoW footprintf %u\n",
+ mem_sharing_get_nr_shared_mfns(),
+ mem_sharing_get_nr_saved_mfns(),
+ dom_cow->tot_pages);
+}
+
void __init mem_sharing_init(void)
{
printk("Initing memory sharing.\n");
diff -r bba44de8394a -r 82d9d136bad6 xen/common/keyhandler.c
--- a/xen/common/keyhandler.c
+++ b/xen/common/keyhandler.c
@@ -15,6 +15,7 @@
#include <xen/compat.h>
#include <xen/ctype.h>
#include <xen/perfc.h>
+#include <xen/mm.h>
#include <asm/debugger.h>
#include <asm/div64.h>
@@ -248,8 +249,8 @@ static void dump_domains(unsigned char k
printk(" refcnt=%d dying=%d pause_count=%d\n",
atomic_read(&d->refcnt), d->is_dying,
atomic_read(&d->pause_count));
- printk(" nr_pages=%d xenheap_pages=%d dirty_cpus=%s max_pages=%u\n",
- d->tot_pages, d->xenheap_pages, tmpstr, d->max_pages);
+ printk(" nr_pages=%d xenheap_pages=%d shared_pages=%u dirty_cpus=%s max_pages=%u\n",
+ d->tot_pages, d->xenheap_pages, atomic_read(&d->shr_pages), tmpstr, d->max_pages);
printk(" handle=%02x%02x%02x%02x-%02x%02x-%02x%02x-"
"%02x%02x-%02x%02x%02x%02x%02x%02x vm_assist=%08lx\n",
d->handle[ 0], d->handle[ 1], d->handle[ 2], d->handle[ 3],
@@ -308,6 +309,8 @@ static void dump_domains(unsigned char k
}
}
+ arch_dump_shared_mem_info();
+
rcu_read_unlock(&domlist_read_lock);
#undef tmpstr
}
diff -r bba44de8394a -r 82d9d136bad6 xen/include/xen/mm.h
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -73,6 +73,9 @@ int assign_pages(
unsigned int order,
unsigned int memflags);
+/* Dump info to serial console */
+void arch_dump_shared_mem_info(void);
+
/* memflags: */
#define _MEMF_no_refcount 0
#define MEMF_no_refcount (1U<<_MEMF_no_refcount)
next prev 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 ` Andres Lagar-Cavilla [this message]
2011-12-09 20:22 ` [PATCH 8 of 9] x86/mm: New domctl: Perform sharing audit Andres Lagar-Cavilla
2011-12-12 9:33 ` 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=82d9d136bad68b0342cb.1323462154@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.