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

Re: [PATCH v3 1/6] xen: do not free reserved memory into heap


  • To: Penny Zheng <Penny.Zheng@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 4 May 2022 15:27:11 +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=BvJtktjFkyufefyAbwFObafdz8RoPHDnq29l09RLCdc=; b=QLnH9kZSlYv39iPKAew6pfobYkXt9EnYf1LxORwQiXVd/tGVwDQK+eZnwPH/9aDDr3+9U8a61WHF3/bbxV6DfTQcJNRLD2d9S6Rqvs4MXM6QV2oYwrNBQXhi59AGkypB1sNEc9ncMGCOOJaWIv7AiaX7Idbt8SgaKKJL/3m04o+nSj7ceZ9fP3eJEp3dJ8P0SOjrfWHETvwaPMnA5wuK/XnPF7t/QztrKUZenkPKd6JgXdI/9p2OEbTB6KZq9pHJqiANpvbrj6TWume6pfknjg4T4tj791dBKMVqo3fDvujLWDOcwozGTKcTpXBDwXXqMxO0zn2tWOEsEIOYi9NJLQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TFIuwjTcUhYabI9+YXqQJKgw9k/yDpVSTl64eEwUosTPdiH8ZanueazlHy3MEyMPAfuCzTwBXXviEbZBQ8H7eWtboiisNKZ2HlimACs7Ic+1r8cl7GDFTGkJ+ERIxvG7UQR2NghR2Rjrz0WcT3P2S6eN2i8No0ceHvbAHXHfIWZKt08ME2unayFnjjMluvJ8/vyI4bs0NW+gGDzcrBDdN8e/trIq8kQ8c6i8YANUfsXizgzZ3u+fTl8hoKiXEYtNW5NRtAgx5l8fv/omMCRFWj2KP2qp4x0PwUzQkJtjhsmQU+ih6PTrvhlSd0Y2gOyN/LmGEbCmZ8Y7Y32ye+2isA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: wei.chen@xxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 04 May 2022 13:27:42 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 28.04.2022 05:01, Penny Zheng wrote:
> --- a/xen/common/page_alloc.c
> +++ b/xen/common/page_alloc.c
> @@ -1443,6 +1443,10 @@ static void free_heap_pages(
>  
>      ASSERT(order <= MAX_ORDER);
>  
> +    if ( pg->count_info & PGC_reserved )
> +        /* Reserved page shall not go back to the heap. */
> +        return free_staticmem_pages(pg, 1UL << order, need_scrub);

With PGC_reserved being zero, the compiler should CSE this call. Hence ...

> @@ -2762,6 +2767,12 @@ int __init acquire_domstatic_pages(struct domain *d, 
> mfn_t smfn,
>  
>      return 0;
>  }
> +#else
> +void free_staticmem_pages(struct page_info *pg, unsigned long nr_mfns,
> +                          bool need_scrub)
> +{
> +    ASSERT_UNREACHABLE();
> +}
>  #endif

... I don't think this is needed?

Jan




 


Rackspace

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