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

Re: [PATCH v8 7/9] xen/arm: unpopulate memory when domain is static


  • To: Penny Zheng <Penny.Zheng@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 8 Jul 2022 14:53:39 +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=N2rZCp2R3TP1sJYg+Uu2b6y/aHhd5RupaI5lUf4TZ20=; b=ZSR/lfVzpN3rJPbxzx6D0ndzqdnFPUNsCNKqmyLZU0fWxfTccV+WD2yIr+4Fj5u8B09vOBWPr6hCpfow2qgrfJ1unKWKnf8J6NxV124WLH4yD7UUHGU+9aZMTX/PMhVOz5mhQxx/7Dsw6+rtUIcu6KLbchHPr+yxY1xqxrPCN8EZRxa2XPUMUWAe30giaxr7HFvEfUYkQMYI4eAL0XebPFUUIufNxbsHOzUupTc+KB0jFP6Ho8lvC7T6gcBAAODiBmEC23s/CMcSHq5fzdF5qpvi4A/FwwkVZHCw5la/ZfcdYJ/v4PUQj7xGcT7Ku3t4Q2rG7au/geoNXGUJYtZnNw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dqLs1/tthdRETem1FhFPtcHO9pyhdWB2t+tVoqsWFCTLjDtn8ZH7XE92hQJoEx+bBRgKnjEg7V/dDgZq1a7OVhCQ7nHCIZmiXCMD+K6NdL1dfIl0ZXs8fc+lMd5t/zO/wApaepyOKzDyJAu0vy25Xe6c698IIukg8WXupE+/IFZr5YEReItbPDMcqDDFXyzZq1P8UgRekzRVBnE0QnhHC8oeLG33aTaNtITjaMCM8/da4EXImcTDLJxR0ZBgVIElL2cWLssoxWIuzSMmY3TCeGhbT/2vInKM4Lv+hYU48tQLwryxM0jTTLyWwDZsLmNilYg8r0niG8zdNTGWapIcZQ==
  • 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: Fri, 08 Jul 2022 12:53:49 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 07.07.2022 11:22, Penny Zheng wrote:
> @@ -2692,6 +2690,14 @@ void free_domstatic_page(struct page_info *page)
>  
>      free_staticmem_pages(page, 1, need_scrub);
>  
> +    if ( likely(d) )
> +    {
> +        /* Add page on the resv_page_list *after* it has been freed. */
> +        if ( !drop_dom_ref )
> +            put_static_page(d, page);

I'm not happy about this name - it suggests similarity with put_page(),
but is entirely different. But: Do we really need an helper macro here
in the first place? This is static-mem specific code and hence ...

> --- a/xen/include/xen/mm.h
> +++ b/xen/include/xen/mm.h
> @@ -91,6 +91,12 @@ void free_staticmem_pages(struct page_info *pg, unsigned 
> long nr_mfns,
>  void free_domstatic_page(struct page_info *page);
>  int acquire_domstatic_pages(struct domain *d, mfn_t smfn, unsigned int 
> nr_mfns,
>                              unsigned int memflags);
> +#ifdef CONFIG_STATIC_MEMORY
> +#define put_static_page(d, page) \
> +    page_list_add_tail((page), &(d)->resv_page_list)

... this can live right at the use site since ...

> --- a/xen/include/xen/sched.h
> +++ b/xen/include/xen/sched.h
> @@ -381,6 +381,9 @@ struct domain
>      struct page_list_head page_list;  /* linked list */
>      struct page_list_head extra_page_list; /* linked list (size extra_pages) 
> */
>      struct page_list_head xenpage_list; /* linked list (size xenheap_pages) 
> */
> +#ifdef CONFIG_STATIC_MEMORY
> +    struct page_list_head resv_page_list; /* linked list */
> +#endif

... this field is consistently available (i.e. it's all the same config
option that controls things).

Otherwise a nit on the macro: While the parentheses around d are needed,
the ones around page are not.

Jan



 


Rackspace

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