[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: Penny Zheng <Penny.Zheng@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 19 Apr 2022 11:10:56 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=FH75j/gPxIjG4KcoeKe+OwXwmNiI3S9NHVYhjyKE1ts=; b=kTbtXxewn4Medl9fssvYp0Ht5TYFwh6xjLEcY9bRjo/MiJYQAay/+EXFjWSYqhrx73kdOKVqeJgalD+pAZVhP1Q4RQsOhVF9WhVaQncbjJENy4XX31D/fOavnHbM7n6Mp81awQ6KpoypP6Q/uCSrW7c3WawuBXTOumyJQ94wumaXpG0m0oswdpi41PDlXJYj4XJzUePanq9Qewm4wzeH14XwIWR4sQXOgqR02AgdifVumC/DoppBnLqTwicZt+cKK8vxL6R2W8wV+BMD9GixbzK+gPR5PHLKgXItsVnQea3rE7NgfuYnU1LxKNqrPsMFgK4sxvMUE+4baIDsp5tpWg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KTnYG8DfVO3BAjvPwN0NF9xCbLUeeZSxnMAUIxGQ+fYw192sn0DrL/S8eW+KhvERFLeQkSHcnbErHqId0bzY5CUMWdXpWGfIwtqKdNFAyVz4FN1kwVekgFhiJVVd3pYym8hAU4oFp/QAhPQKjyIfrrwzMpEVz4qkyCy1CMManhSl4vQ/psHKpwtqYoqSbianPqPcX1qjrRqbSALba7Q42yQdI+B6mCRZMvepVFFqM4rh/ks7lSRAwXNBPjxhKt77Fa0AGtNPbsd/HSISnmqomZaTj/vO1FrRU2Xgzcvx4WJb1xRqZYDx+eXBv+m0m3oFGqRMSwJeXxt+uPwV1fKYRA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: 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
  • Delivery-date: Tue, 19 Apr 2022 09:11:07 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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.

Jan




 


Rackspace

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