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

RE: [PATCH v4 1/6] xen: do not free reserved memory into heap


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "julien@xxxxxxx" <julien@xxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Wed, 18 May 2022 02:29:24 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • 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=2; 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=0cLZcfcsapKxpJ/nIooyjnkFCSdNKz2n/GKOE6cMTEU=; b=BFdOtFJzZHpr987p97o6vcdDShMcSJRPXF8d3a2IyPGCKf2/HGHzTSfGNGCb8st5qDb0bZ7Lj/ZCtlIMA6rAKHiFQbfotIFmfD5+Bb2NxO5J52M3UyOeTZAJShqz2ciX8avtvS2igFKROv/zK90aTvHZYFM0KUvwORcblh0eoeTq3ayyDy0dfNdAD7sHkU8pxvYSLL4QOFRHPLBzN9A/Eke15fZvBJsjAF+Fv+LjOTgYiKlYd60831ixICTEYjf6oDVYCuvIoUeEBEhn6HwryLLgI8ZZWZowv805eyqQygMSoz2RBhXktqhkt5Eb1JtsUPkUO3G9b1ULmIs8AIsj+g==
  • 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=0cLZcfcsapKxpJ/nIooyjnkFCSdNKz2n/GKOE6cMTEU=; b=bl1EtYMxD+DmBuY6vKGjK3NKUHh6bmD3M1VqbC9kuTlhoeMv+U9GROkiKcArJofAXvuwWU4ymTtcSvQtZIVR/Q1BVol5V9P56rJ5GvcHWea3xN6Bl99jbYIz4mDolKihJJPJ4RttH2PXf/bCzPYIpcRpE07uYNZdGFSwVoo8mRhFnSELZdd+BlS5En7zPZ9aPLm+pCzTOmOf914hS8K5jBM5LGFKwh+kz6xnUfuooX/y6NtRfcm9IZK3FSeMRz57jQ2tTXlDlemjC3GcQlRDvzsTL+/zyqBbItUbTWTDGLwpGR7+q8sWoYaam/+3VcP3eJji1/K8eJMbC9tADBRibA==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=AKbZCYTN5Yz3nTzwuQ4j4DpgVpPUPVe8Tg5WX5dipIJ1jzW/zdSFY2GWOZ5krTFNTI+/sPPDMG61Ov8fJ/S4iR0YUf+txqsBbIn3b/XTH/1PVW5LpzgNpTkzi/5gbBnCDRnq+5TuMa6fJgo3rwI9L8R+3LD23TGIPSDstACy5uwhDI43P7ZqczFfecH3oo65ZlJ5bnOE/P4wLt25/+2wRBDVX8Mst1RlkCpQlkzE7IE6UTOB09K6Ept/UBXwBgweOqwpt/2i+S+OIQLnWFEC0eNqYmm8wQpPmsHIc1pMYdgUTZVBuPDV9/DUjhuu2aE66NaN4MFyjFHtUomy6Kj5ig==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ng9lLEs2aysmTnixiV5xp/lB6owdcrleYb08APvFkPV/Li+ygy8xQ6yb2JAJYZQrjVkyu9GqTUGmkELuKgrrRD+uU6VXc36I/+acodzt2F6dNYSbMyDOVmXe+AMn5eFtamVMQfAGzK1YXqI9XDZ66q+xF64NDXWwZpnsEk1IPrQ7AeRZwSKgKOxqRYwDpjhgDVYgB/t8MS9B1CjBxvoF6yrkx0cdze8eP/1RRxtk0jmBh8e0t5nIaSSi4ndbq9bKc0ZVpjfBH536ChhUMValpENLkbQp0bwtPPMDPPoKQeygeSzcBJMq65l0X6KhW+JXy5YggiZAiCYF2w597cD43A==
  • 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>, 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" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 18 May 2022 02:29:58 +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: AQHYZBWe/uxRZBdW10mDRgQaF95/K60jSVqAgACnZgA=
  • Thread-topic: [PATCH v4 1/6] xen: do not free reserved memory into heap

Hi Jan and Julien

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: Wednesday, May 18, 2022 12:11 AM
> To: Penny Zheng <Penny.Zheng@xxxxxxx>
> Cc: Wei Chen <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
> Subject: Re: [PATCH v4 1/6] xen: do not free reserved memory into heap
> 
> On 10.05.2022 04:27, Penny Zheng wrote:
> > @@ -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
> 
> As before I do not agree that we need this (or similar) stub functions. As
> already suggested I think that instead Arm wants to #define PGC_reserved (to
> non-zero) only when !CONFIG_STATIC_MEMORY, just like is already the case
> on x86.
> 

Ok, if you do not like the stub function, then what about I putting the 
#ifdef-array back
to the common where free_staticmem_pages is used:
#ifdef CONFIG_STATIC_MEMORY
        if ( pg->count_info & PGC_reserved )
            /* Reserved page shall not go back to the heap. */
            return free_staticmem_pages(pg, 1UL << order, need_scrub);
#endif
If this is not the option here too, before I make the change about guarding the
PGC_reserved with CONFIG_STATIC_MEMORY on ARM, I'd like to cc Julien here,
Since in the very beginning when we introduced PGC_reserved flag, he might have
concerns about limiting the usage of PGC_reserved to static memory, if he is
okay now, I'm fine too. ;)

> Jan


 


Rackspace

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