[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: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Thu, 5 May 2022 05:12:26 +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=r7rbIplsgsshtyg3MjoASS19Py1Ag1wvmhbDkdc8Cv8=; b=lI/SXP9ouS7P46cbCPt5sUxsCUfQke+q6/VcfMr10qxL2b4h0lyC+x32/3Iw7aPRem4p/oyJbjwJOfDL4WAKe0nRIlYm+/nZHl88yfmneOw6ea6dgkza+eiQwp4scXZfgRN9rYyWE/oF+R2m6q6xsaOyHLUOIL3POnoaCz/+FWlIqLoFYvhQFS8DDDZdgvdkPhaiDxh4epoCZ0cFhi2WGsjxOLStFyMfeWVDrk5Ip/26D7hn+AOpZwv86g2uf3We62OXjGv6IaaNPDt993cMqCQlTvda0wv93hYZDbCzzMXzSSJZ/jYVSLRDL0lPsh79zDYYrWbnSn7fv0XAMF1dpg==
  • 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=r7rbIplsgsshtyg3MjoASS19Py1Ag1wvmhbDkdc8Cv8=; b=AEpyzYO1hst7HwZkrecmXAfGHToqXtOZp+tRE+ekcsyp8aVHEQu2I1yWQGZ/Upk0q0w4pFxj4cH6n0MViim+zFHhKwE6wkKtYOMMfSoe+ML4Xu9h2u/QM76AjuGVb/4Lz1vS04Qn2kXEIc5U+BKusSk4vLR3AeTU49oBrbvxUhrgOlfRltoyA9406ZkcKGy8SXB0zx7WOFGSxxrb1U9+uNsAeph9ienGctxnxwbPIaZPOoWZxWlT4vhbweZUvxSgmxXKZ6nKjAduB9Llzs1zpK4qSew7xDWLd9b4vtxyxk7/cCdGmxRWW1jDOnFvRyR6T9MHzvmWX+/iw2RbzCUYPA==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=AjhkM2a+UE4UJwkfIE/+yw3uaHcT2wDeI4teEJ6kdZs41XT++YJQMMprpUonoPwaueu2SHlyXYX475STeYJ2SK9w3gxtxC0Q3xRkwe+Ogt9m9LXygZ4SUTIBLMJ085NVI4I+1J/e8mg8IiVJS+GNrVPZoZ98r72jbbG3/jKVkgxkJlfkEkKOdUfIk8SiiY4tIxfw213muf+00VJXvwOnXrHNxzdTvD17vjMOVh83hNvV1LEYAFSG5/g8/3YjvMvT2BEiDeC1YDaVq8u7NgjK9fSbyF+UqWD/G94HbYKgQNwy4aU5uZ89cgyTZwHmPsazJ2sFitXfEEhrRIC65izF9A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P5Dy1wAazm9PViZ4YRwnd2sp5gaZxxlN6KOs3sV6xpk5PD6sg4nSoowaneMdc+qjvfKprBrFG5mGF0BwE/LiqtPijKkBFAulgVORB0TIBJTccnA11CU5N556BCYeoq1PBdHtPcRF5uuTQ/MUgIEe51kWqZm4J2M0AtIL0ULpQ/Ep9YGr4AhF+XdiQbxCKg3+7RYFqG0iIJhenZmqSpiiN+IkVa5BH6VljbsDahA28bfEJKFjj5Z2Y/365/VZnbV+tewBZDO5KjNmUQUvTL0ERB+MD2BLLCylYOVkVE7zUuLjfw+859n9P4I+JyudhQ9tefr/x5nJ40SL5526Qaeclw==
  • 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: Thu, 05 May 2022 05:12:55 +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: AQHYWqxrPp+knbswwky8XjTDnza4CK0Ov/mAgADdzUA=
  • Thread-topic: [PATCH v3 1/6] xen: do not free reserved memory into heap

Hi jan

> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: Wednesday, May 4, 2022 9:27 PM
> 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 v3 1/6] xen: do not free reserved memory into heap
> 
> 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 ...
> 

I assume that you suggest that we remove the stub function and just let
free_staticmem_pages not guarded by CONFIG_STATIC_MEMORY any more?
 
Hmmmm, on x86, PGC_reserved will be zero as not defined, and CSE will leave
no caller here.  but on arm, CSE could not guard this?
 
> > @@ -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®.