From: Tim Deegan <tim@xen.org>
To: xen-devel@lists.xen.org
Subject: [PATCH 2/5] x86/mm: warn if we ever run out of shadow/hap pool for p2m/lgd ops.
Date: Thu, 7 Mar 2013 14:53:00 +0000 [thread overview]
Message-ID: <1362667983-24938-3-git-send-email-tim@xen.org> (raw)
In-Reply-To: <1362667983-24938-1-git-send-email-tim@xen.org>
Even if the error propagates up through the p2m ops to the caller,
it'll look like ENOMEM, which won't be obviously a shadow-pool problem.
Warn on the console, once per domain.
Signed-off-by: Tim Deegan <tim@xen.org>
---
xen/arch/x86/mm/hap/hap.c | 6 ++++++
xen/arch/x86/mm/shadow/common.c | 8 +++++++-
xen/include/asm-x86/domain.h | 2 ++
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c
index 055833d..bff05d9 100644
--- a/xen/arch/x86/mm/hap/hap.c
+++ b/xen/arch/x86/mm/hap/hap.c
@@ -258,6 +258,12 @@ static struct page_info *hap_alloc_p2m_page(struct domain *d)
page_set_owner(pg, d);
pg->count_info |= 1;
}
+ else if ( !d->arch.paging.p2m_alloc_failed )
+ {
+ d->arch.paging.p2m_alloc_failed = 1;
+ dprintk(XENLOG_ERR, "d%i failed to allocate from HAP pool",
+ d->domain_id);
+ }
paging_unlock(d);
return pg;
diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c
index 691776c..4b576ac 100644
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -1591,10 +1591,16 @@ shadow_alloc_p2m_page(struct domain *d)
if ( d->arch.paging.shadow.total_pages
< shadow_min_acceptable_pages(d) + 1 )
{
+ if ( !d->arch.paging.p2m_alloc_failed )
+ {
+ d->arch.paging.p2m_alloc_failed = 1;
+ dprintk(XENLOG_ERR, "d%i failed to allocate from shadow pool",
+ d->domain_id);
+ }
paging_unlock(d);
return NULL;
}
-
+
shadow_prealloc(d, SH_type_p2m_table, 1);
pg = mfn_to_page(shadow_alloc(d, SH_type_p2m_table, 0));
d->arch.paging.shadow.p2m_pages++;
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index fd9fa0f..6f9744a 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -190,6 +190,8 @@ struct paging_domain {
* (used by p2m and log-dirty code for their tries) */
struct page_info * (*alloc_page)(struct domain *d);
void (*free_page)(struct domain *d, struct page_info *pg);
+ /* Has that pool ever run out of memory? */
+ bool_t p2m_alloc_failed;
};
struct paging_vcpu {
--
1.7.10.4
next prev parent reply other threads:[~2013-03-07 14:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-07 14:52 [PATCH 0/5] x86/mm: out-of-memory errors in p2m ops Tim Deegan
2013-03-07 14:52 ` [PATCH 1/5] x86/mm: use bool_t for flags in shadow-pagetable structs Tim Deegan
2013-03-07 14:53 ` Tim Deegan [this message]
2013-03-07 15:22 ` [PATCH 2/5] x86/mm: warn if we ever run out of shadow/hap pool for p2m/lgd ops Andrew Cooper
2013-03-07 15:34 ` Jan Beulich
2013-03-07 14:53 ` [PATCH 3/5] x86/ept: check for errors in a few callers of ept_set_entry Tim Deegan
2013-03-07 14:53 ` [PATCH 4/5] x86/mem_sharing: check for errors in p2m->set_entry() Tim Deegan
2013-03-07 15:07 ` Andres Lagar-Cavilla
2013-03-07 16:10 ` Tim Deegan
2013-03-07 16:49 ` Andres Lagar-Cavilla
2013-03-07 14:53 ` [PATCH 5/5] x86/mem_access: " Tim Deegan
2013-03-07 21:50 ` Aravindh Puthiyaparambil
2013-03-07 15:38 ` [PATCH 0/5] x86/mm: out-of-memory errors in p2m ops Jan Beulich
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=1362667983-24938-3-git-send-email-tim@xen.org \
--to=tim@xen.org \
--cc=xen-devel@lists.xen.org \
/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.