Re: [PATCH v5 07/13] xen/page_alloc: introduce init_free_page_fields() helper

2024-01-12 Thread Carlo Nonato
Hi Jan,

On Tue, Jan 9, 2024 at 11:36 AM Jan Beulich  wrote:
>
> On 02.01.2024 10:51, Carlo Nonato wrote:
> > Introduce a new helper to initialize fields that have different uses for
> > free pages.
> >
> > Signed-off-by: Carlo Nonato 
> > Signed-off-by: Marco Solieri 
>
> I might in principle ack this change, but what's the deal with this 2nd
> S-o-b? The typical expectation is for yours to be last, and the 1st one
> being the original author's (which generally means you can't be the
> original author in such a case, yet the absence of a From: suggests
> you are).

You're right. I mistakenly copied it from other patches.
I did the same in #10. Will remove Marco Solieri from those.
But there are some patches where we are both authors, so I will leave both
Signed-off-by.

Thanks.

> Jan



Re: [PATCH v5 07/13] xen/page_alloc: introduce init_free_page_fields() helper

2024-01-09 Thread Jan Beulich
On 02.01.2024 10:51, Carlo Nonato wrote:
> Introduce a new helper to initialize fields that have different uses for
> free pages.
> 
> Signed-off-by: Carlo Nonato 
> Signed-off-by: Marco Solieri 

I might in principle ack this change, but what's the deal with this 2nd
S-o-b? The typical expectation is for yours to be last, and the 1st one
being the original author's (which generally means you can't be the
original author in such a case, yet the absence of a From: suggests
you are).

Jan



[PATCH v5 07/13] xen/page_alloc: introduce init_free_page_fields() helper

2024-01-02 Thread Carlo Nonato
Introduce a new helper to initialize fields that have different uses for
free pages.

Signed-off-by: Carlo Nonato 
Signed-off-by: Marco Solieri 
---
v5:
- new patch
---
 xen/common/page_alloc.c | 16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c
index d874525916..9ee3981bb5 100644
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -928,6 +928,13 @@ static struct page_info *get_free_buddy(unsigned int 
zone_lo,
 }
 }
 
+/* Initialise fields which have other uses for free pages. */
+static void init_free_page_fields(struct page_info *pg)
+{
+pg->u.inuse.type_info = PGT_TYPE_INFO_INITIALIZER;
+page_set_owner(pg, NULL);
+}
+
 /* Allocate 2^@order contiguous pages. */
 static struct page_info *alloc_heap_pages(
 unsigned int zone_lo, unsigned int zone_hi,
@@ -1036,10 +1043,7 @@ static struct page_info *alloc_heap_pages(
 accumulate_tlbflush(_tlbflush, [i],
 _timestamp);
 
-/* Initialise fields which have other uses for free pages. */
-pg[i].u.inuse.type_info = PGT_TYPE_INFO_INITIALIZER;
-page_set_owner([i], NULL);
-
+init_free_page_fields([i]);
 }
 
 spin_unlock(_lock);
@@ -2802,9 +2806,7 @@ static bool prepare_staticmem_pages(struct page_info *pg, 
unsigned long nr_mfns,
  * to PGC_state_inuse.
  */
 pg[i].count_info = PGC_static | PGC_state_inuse;
-/* Initialise fields which have other uses for free pages. */
-pg[i].u.inuse.type_info = PGT_TYPE_INFO_INITIALIZER;
-page_set_owner([i], NULL);
+init_free_page_fields([i]);
 }
 
 spin_unlock(_lock);
-- 
2.34.1