All of lore.kernel.org
 help / color / mirror / Atom feed
From: Penny Zheng <Penny.Zheng@arm.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Wei Chen <Wei.Chen@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>, Wei Liu <wl@xen.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: RE: [PATCH v2 5/6] xen/arm: unpopulate memory when domain is static
Date: Mon, 25 Apr 2022 06:34:04 +0000	[thread overview]
Message-ID: <DU2PR08MB73253426B332CFF5358AB346F7F89@DU2PR08MB7325.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <b76b3207-4eb7-5236-6812-d64cd4dad17f@suse.com>

Hi jan

> -----Original Message-----
> From: Jan Beulich <jbeulich@suse.com>
> Sent: Tuesday, April 19, 2022 5:11 PM
> To: Penny Zheng <Penny.Zheng@arm.com>
> Cc: Wei Chen <Wei.Chen@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>;
> Wei Liu <wl@xen.org>; xen-devel@lists.xenproject.org
> Subject: Re: [PATCH v2 5/6] xen/arm: unpopulate memory when domain is
> static
> 
> On 18.04.2022 14:22, Penny Zheng wrote:
> > --- a/xen/arch/arm/include/asm/mm.h
> > +++ b/xen/arch/arm/include/asm/mm.h
> > @@ -358,6 +358,23 @@ void clear_and_clean_page(struct page_info
> > *page);
> >
> >  unsigned int arch_get_dma_bitsize(void);
> >
> > +/*
> > + * Put free pages on the resv page list after having taken them
> > + * off the "normal" page list, when pages from static memory  */
> > +#ifdef CONFIG_STATIC_MEMORY
> > +#define arch_free_heap_page(d, pg) {                    \
> > +    if ( (pg)->count_info & PGC_reserved )              \
> > +    {                                                   \
> > +        page_list_del(pg, page_to_list(d, pg));         \
> > +        page_list_add_tail(pg, &(d)->resv_page_list);   \
> > +        (d)->resv_pages++;                              \
> 
> There's no consumer of this counter, so I'd like to ask that it be introduced
> once a consumer appears.
> 
> > +    }                                                   \
> > +    else                                                \
> > +        page_list_del(pg, page_to_list(d, pg));         \
> 
> Is there a particular reason to have this page_list_del() twice, instead of just
> once ahead of the if()?
> 
> > +}
> 
> Also this entire construct want to be an expression, not a
> (compound) statement. And it probably would better evaluate its parameters
> just once.
> 

#define arch_free_heap_page(d, pg) {                    \
        page_list_del(pg, page_to_list(d, pg));             \
        if ( (pg)->count_info & PGC_reserved )              \
             page_list_add_tail(pg, &(d)->resv_page_list);   \
}

I'm trying to refine the arch_free_heap_page() here, but I'm a bit confused
about to let it be an expression, not a compound statement.  Do you mean that
you prefer to let the if-clause out of the arch_free_heap_page()?

> Jan


  reply	other threads:[~2022-04-25  6:35 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-18 12:22 [PATCH V2 0/6] populate/unpopulate memory when domain on static Penny Zheng
2022-04-18 12:22 ` [PATCH v2 1/6] xen/arm: do not free reserved memory into heap Penny Zheng
2022-04-19  8:59   ` Jan Beulich
2022-04-19 10:25     ` Penny Zheng
2022-04-18 12:22 ` [PATCH v2 2/6] xen/arm: do not merge reserved pages in free_heap_pages() Penny Zheng
2022-04-18 12:22 ` [PATCH v2 3/6] xen: add field "flags" to cover all internal CDF_XXX Penny Zheng
2022-04-19  9:02   ` Jan Beulich
2022-04-18 12:22 ` [PATCH v2 4/6] xen/arm: introduce CDF_staticmem Penny Zheng
2022-04-21  0:08   ` Stefano Stabellini
2022-04-18 12:22 ` [PATCH v2 5/6] xen/arm: unpopulate memory when domain is static Penny Zheng
2022-04-19  9:10   ` Jan Beulich
2022-04-25  6:34     ` Penny Zheng [this message]
2022-04-25  8:00       ` Jan Beulich
2022-04-25  8:21         ` Penny Zheng
2022-04-18 12:22 ` [PATCH v2 6/6] xen/arm: retrieve reserved pages on populate_physmap Penny Zheng
2022-04-19  9:14   ` Jan Beulich
2022-04-19  8:46 ` [PATCH V2 0/6] populate/unpopulate memory when domain on static Jan Beulich
2022-04-19  9:11   ` Penny Zheng

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=DU2PR08MB73253426B332CFF5358AB346F7F89@DU2PR08MB7325.eurprd08.prod.outlook.com \
    --to=penny.zheng@arm.com \
    --cc=Bertrand.Marquis@arm.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=Wei.Chen@arm.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --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.