All of lore.kernel.org
 help / color / mirror / Atom feed
From: Penny Zheng <Penny.Zheng@arm.com>
To: xen-devel@lists.xenproject.org
Cc: wei.chen@arm.com, Penny Zheng <Penny.Zheng@arm.com>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>, Wei Liu <wl@xen.org>,
	Penny Zheng <penny.zheng@arm.com>
Subject: [PATCH v11 5/6] xen: rename free_staticmem_pages to unprepare_staticmem_pages
Date: Wed, 31 Aug 2022 10:40:40 +0800	[thread overview]
Message-ID: <20220831024041.468757-6-Penny.Zheng@arm.com> (raw)
In-Reply-To: <20220831024041.468757-1-Penny.Zheng@arm.com>

The name of free_staticmem_pages is inappropriate, considering it is
the opposite of function prepare_staticmem_pages.

Rename free_staticmem_pages to unprepare_staticmem_pages.

Signed-off-by: Penny Zheng <penny.zheng@arm.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
v11 changes:
- moved ahead of "xen: retrieve reserved pages on populate_physmap"
---
v10 changes:
- new commit
---
 xen/arch/arm/setup.c    |  3 ++-
 xen/common/page_alloc.c | 13 ++++++++-----
 xen/include/xen/mm.h    |  4 ++--
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index 500307edc0..4662997c7e 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -639,7 +639,8 @@ static void __init init_staticmem_pages(void)
             if ( mfn_x(bank_end) <= mfn_x(bank_start) )
                 return;
 
-            free_staticmem_pages(mfn_to_page(bank_start), bank_pages, false);
+            unprepare_staticmem_pages(mfn_to_page(bank_start),
+                                      bank_pages, false);
         }
     }
 #endif
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index adcc16e4f6..18d34d1b69 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -2693,9 +2693,12 @@ struct domain *get_pg_owner(domid_t domid)
 }
 
 #ifdef CONFIG_STATIC_MEMORY
-/* Equivalent of free_heap_pages to free nr_mfns pages of static memory. */
-void free_staticmem_pages(struct page_info *pg, unsigned long nr_mfns,
-                          bool need_scrub)
+/*
+ * It is the opposite of prepare_staticmem_pages, and it aims to unprepare
+ * nr_mfns pages of static memory.
+ */
+void unprepare_staticmem_pages(struct page_info *pg, unsigned long nr_mfns,
+                               bool need_scrub)
 {
     mfn_t mfn = page_to_mfn(pg);
     unsigned long i;
@@ -2741,7 +2744,7 @@ void free_domstatic_page(struct page_info *page)
 
     drop_dom_ref = !domain_adjust_tot_pages(d, -1);
 
-    free_staticmem_pages(page, 1, scrub_debug);
+    unprepare_staticmem_pages(page, 1, scrub_debug);
 
     /* Add page on the resv_page_list *after* it has been freed. */
     page_list_add_tail(page, &d->resv_page_list);
@@ -2862,7 +2865,7 @@ int __init acquire_domstatic_pages(struct domain *d, mfn_t smfn,
 
     if ( assign_pages(pg, nr_mfns, d, memflags) )
     {
-        free_staticmem_pages(pg, nr_mfns, memflags & MEMF_no_scrub);
+        unprepare_staticmem_pages(pg, nr_mfns, memflags & MEMF_no_scrub);
         return -EINVAL;
     }
 
diff --git a/xen/include/xen/mm.h b/xen/include/xen/mm.h
index deadf4b2a1..93db3c4418 100644
--- a/xen/include/xen/mm.h
+++ b/xen/include/xen/mm.h
@@ -86,8 +86,8 @@ bool scrub_free_pages(void);
 #define FREE_XENHEAP_PAGE(p) FREE_XENHEAP_PAGES(p, 0)
 
 /* These functions are for static memory */
-void free_staticmem_pages(struct page_info *pg, unsigned long nr_mfns,
-                          bool need_scrub);
+void unprepare_staticmem_pages(struct page_info *pg, unsigned long nr_mfns,
+                               bool need_scrub);
 void free_domstatic_page(struct page_info *page);
 int acquire_domstatic_pages(struct domain *d, mfn_t smfn, unsigned int nr_mfns,
                             unsigned int memflags);
-- 
2.25.1



  parent reply	other threads:[~2022-08-31  2:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-31  2:40 [PATCH v11 0/6] populate/unpopulate memory when domain on static allocation Penny Zheng
2022-08-31  2:40 ` [PATCH v11 1/6] xen: do not free reserved memory into heap Penny Zheng
2022-08-31  2:40 ` [PATCH v11 2/6] xen/arm: introduce CDF_staticmem Penny Zheng
2022-08-31  2:40 ` [PATCH v11 3/6] xen: unpopulate memory when domain is static Penny Zheng
2022-08-31  2:40 ` [PATCH v11 4/6] xen: introduce prepare_staticmem_pages Penny Zheng
2022-08-31  2:40 ` Penny Zheng [this message]
2022-09-01 13:18   ` [PATCH v11 5/6] xen: rename free_staticmem_pages to unprepare_staticmem_pages Julien Grall
2022-08-31  2:40 ` [PATCH v11 6/6] xen: retrieve reserved pages on populate_physmap Penny Zheng
2022-09-01 13:52   ` Julien Grall
2022-09-02  7:10     ` Penny Zheng
2022-08-31 22:44 ` [PATCH v11 0/6] populate/unpopulate memory when domain on static allocation Stefano Stabellini
2022-09-01  8:01   ` Julien Grall

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=20220831024041.468757-6-Penny.Zheng@arm.com \
    --to=penny.zheng@arm.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=bertrand.marquis@arm.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=wei.chen@arm.com \
    --cc=wl@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 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.