[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] make better use of mfn local variable in free_heap_pages()



commit 7a8d8bde9820387c3e168182b99fd9761c223fff
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue Aug 25 17:47:27 2020 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue Aug 25 17:47:27 2020 +0200

    make better use of mfn local variable in free_heap_pages()
    
    Besides the one use that there is in the function (of the value
    calculated at function entry), there are two more places where the
    redundant page-to-address conversion can be avoided.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Julien Grall <jgrall@xxxxxxxxxx>
    Reviewed-by: Wei Liu <wl@xxxxxxx>
---
 xen/common/page_alloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index 10b7aeca48..4e86d79935 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -1380,7 +1380,7 @@ static void free_heap_pages(
 {
     unsigned long mask;
     mfn_t mfn = page_to_mfn(pg);
-    unsigned int i, node = phys_to_nid(page_to_maddr(pg)), tainted = 0;
+    unsigned int i, node = phys_to_nid(mfn_to_maddr(mfn)), tainted = 0;
     unsigned int zone = page_to_zone(pg);
 
     ASSERT(order <= MAX_ORDER);
@@ -1417,7 +1417,7 @@ static void free_heap_pages(
         default:
             printk(XENLOG_ERR
                    "pg[%u] MFN %"PRI_mfn" c=%#lx o=%u v=%#lx t=%#x\n",
-                   i, mfn_x(page_to_mfn(pg + i)),
+                   i, mfn_x(mfn) + i,
                    pg[i].count_info, pg[i].v.free.order,
                    pg[i].u.free.val, pg[i].tlbflush_timestamp);
             BUG();
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.