From: Julien Grall <julien.grall@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Keir Fraser <keir@xen.org>,
George Dunlap <george.dunlap@eu.citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Dario Faggioli <dario.faggioli@citrix.com>,
Julien Grall <julien.grall@citrix.com>,
Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v2] x86/mm: pod: Use the correct memory flags for alloc_domheap_page{, s}
Date: Fri, 23 Oct 2015 11:33:10 +0100 [thread overview]
Message-ID: <1445596390-31298-1-git-send-email-julien.grall@citrix.com> (raw)
The last parameter of alloc_domheap_page{s,} contain the memory flags and
not the order of the allocation.
Use 0 for the call in p2m_pod_set_cache_target as it was before
1069d63c5ef2510d08b83b2171af660e5bb18c63 "x86/mm/p2m: use defines for
page sizes". Note that PAGE_ORDER_4K is also equal to 0 so the behavior
stays the same.
For the call in p2m_pod_offline_or_broken_replace we want to allocate
the new page on the same numa node as the previous page. So retrieve the
numa node and pass it in the memory flags.
Signed-off-by: Julien Grall <julien.grall@citrix.com>
---
Note that the patch has only been build tested.
Cc: George Dunlap <george.dunlap@eu.citrix.com>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Dario Faggioli <dario.faggioli@citrix.com>
Changes in v2:
- Change the behavior of p2m_pod_offline_or_broken_replace
to allocate the new page on the same numa node as the previous
page.
---
xen/arch/x86/mm/p2m-pod.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c
index 901da37..acd85ea 100644
--- a/xen/arch/x86/mm/p2m-pod.c
+++ b/xen/arch/x86/mm/p2m-pod.c
@@ -222,7 +222,7 @@ p2m_pod_set_cache_target(struct p2m_domain *p2m, unsigned long pod_target, int p
else
order = PAGE_ORDER_4K;
retry:
- page = alloc_domheap_pages(d, order, PAGE_ORDER_4K);
+ page = alloc_domheap_pages(d, order, 0);
if ( unlikely(page == NULL) )
{
if ( order == PAGE_ORDER_2M )
@@ -471,13 +471,14 @@ p2m_pod_offline_or_broken_replace(struct page_info *p)
{
struct domain *d;
struct p2m_domain *p2m;
+ nodeid_t node = phys_to_nid(page_to_maddr(p));
if ( !(d = page_get_owner(p)) || !(p2m = p2m_get_hostp2m(d)) )
return;
free_domheap_page(p);
- p = alloc_domheap_page(d, PAGE_ORDER_4K);
+ p = alloc_domheap_page(d, MEMF_node(node));
if ( unlikely(!p) )
return;
--
2.1.4
next reply other threads:[~2015-10-23 10:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-23 10:33 Julien Grall [this message]
2015-10-23 13:50 ` [PATCH v2] x86/mm: pod: Use the correct memory flags for alloc_domheap_page{, s} Dario Faggioli
2015-10-26 10:29 ` George Dunlap
2015-10-26 10:40 ` Jan Beulich
2015-10-26 10:53 ` George Dunlap
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=1445596390-31298-1-git-send-email-julien.grall@citrix.com \
--to=julien.grall@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=dario.faggioli@citrix.com \
--cc=george.dunlap@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=keir@xen.org \
--cc=xen-devel@lists.xenproject.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 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).