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

RE: [PATCH v2 5/6] xen/arm: unpopulate memory when domain is static


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Mon, 25 Apr 2022 08:21:08 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LeMk/pZtcVi2z/1bgpqfXlqAMEpb1KOGkd+nuALoPew=; b=LWqJWX+X6MZO+2FAC4IDLC+SDOm8o7VrElvYDF2jECxeAiod0zlKon/hlhFBpV42hMPIH4Ka9rBX988FWFT7MjJ27Xf5p+y2/VB+k0cqFi1yh/LzEBUJ7ok30SJgzoN1+oAFGrwnuomA/yiwcNd1IEZD1ESAu4UH6ZhBcP6rxVoSg5yAkGU9Ly/sSn7nGToWT6w1oJlbDhw7GkfOmi7RF1m99g3gmAHb5/2++VdodVE+xjPNND/QaJa2UneNKTMK+CvlE+7sH0LVc3tSSoQxMtJZJJUoYy1yhX38w+VRxDwp0nPObBiM3wQopIY/tr5Fn/kHNEXr4/OZYw4C8p9gSw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gCqbeOJ1c41m05djo1/Neh/b7TPbri1S1QiCFRJsTX7tpDfG3cIeLPHuYXzODM7l2+xLRcdjdgjS6PBDEoVu6XqHPvFAI9Ws+rmn++9F0ZB9V5q3EpYGNYhGwjBUDUEnkAuY+kaKHZQzttnjNAkd7CgGJryKX2VN70HwtxZ66chis2u7ZAgdLFV8oovo0H49OZArqwyLp0IJR0GpoD9iBpKidNY0FFpLYU7W2605jchgGG9SBpS2CZ4WMrxyVjoPjLo7Um4wKofU9LTrHpuRQ6pvu0V31ZFzNniHNqdCaH41/dLj+qa+aRlHsENwOK9Jfr26lh3BRGbqabFsSDVJjw==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Wei Chen <Wei.Chen@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 25 Apr 2022 08:21:36 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYUx8sjuusUaZZhUW8Wxz6RmBB9Kz29IIAgAk/PSCAABseAIAABFLw
  • Thread-topic: [PATCH v2 5/6] xen/arm: unpopulate memory when domain is static

Hi, jan

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: Monday, April 25, 2022 4:01 PM
> To: Penny Zheng <Penny.Zheng@xxxxxxx>
> Cc: Wei Chen <Wei.Chen@xxxxxxx>; Stefano Stabellini
> <sstabellini@xxxxxxxxxx>; Julien Grall <julien@xxxxxxx>; Bertrand Marquis
> <Bertrand.Marquis@xxxxxxx>; Volodymyr Babchuk
> <Volodymyr_Babchuk@xxxxxxxx>; Andrew Cooper
> <andrew.cooper3@xxxxxxxxxx>; George Dunlap <george.dunlap@xxxxxxxxxx>;
> Wei Liu <wl@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH v2 5/6] xen/arm: unpopulate memory when domain is
> static
> 
> On 25.04.2022 08:34, Penny Zheng wrote:
> >> -----Original Message-----
> >> From: Jan Beulich <jbeulich@xxxxxxxx>
> >> Sent: Tuesday, April 19, 2022 5:11 PM
> >>
> >> 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()?
> 
> No. You want to put parentheses around the braces, using a gcc extension we
> make extensive use of throughout the code base.
> 

Oh, oh, thanks!
put parentheses around the braces, then that's what you said about make it 
be an expression

> Jan


 


Rackspace

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