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

RE: [PATCH v3 5/6] xen/arm: unpopulate memory when domain is static


  • To: Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Wed, 27 Apr 2022 10:31:47 +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=AM7MWqmL5pFftgoohB0muhAA5IdoLr9JxzahZUAs0XE=; b=Ge2dNKJ0xwIg3+jrX3/4jrmUtinqdagWDCzMmhvbgZAZA8Jt/aSyP6AUe3GLQSCwq09+wmeTVx3uD+pfvM1GTHkX9AZz5UAZRJjguI1uQB6oR/Mu/Kk2H69KTKN1URDguJy9GKRj4JhDqe0kX1irUyK1Y/Kie0QHDp/+MdQwBFgjKaGVwQFtef6M3B1x7L2OIP2XwWQ/512p6OVvjGRvDC5tp+GqoEBsAo/2ZPYwA1upnNCx7emXw0a5YqOq4c3gSYI9Tl2S+DzwRq5FMwGeI9Y/ThxHlxjDJoY9czV+IQNojPhLAwT6QULZ0WVBqWFW4y9vGcn4O5+x3yKIIdvjjQ==
  • 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=AM7MWqmL5pFftgoohB0muhAA5IdoLr9JxzahZUAs0XE=; b=XRNENRfbqp1gCVr19scDm7UNK7bLms0psFQw4ZLjnyo5poJXBWYNdgnaxABVF1YjU2FQr+vcr9pKw7Hajmx61bQGWhYhIpWOgaRPljKOGqpKzrGzWmK2s7/uXCAFFsGXVb0C0D5SoYf/J+VRv3nkHc923urMN84bJvy/iaIGhSohPbXZOuISDyZ7iVwu24A41ejEvx1am/VFYCztV6j8a/7MnbKPEDT/p9woS/IZGSfiHVYhb/wIIp1sXkxGs41Dv3AXL2WBLbRbMbmO1HHAG8AXWtPBfKbtOUn8iNEMIgtEUWRLaR5/J34IwfJag4QkO8pyKxz0fkiPGRMqHzBZqg==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=eTs1R2inM40Fop8O2Rx+BQY7yz2GtTm/6iFuoqjZZygmNKb54OFAbgglo72mZ4Ito7PX8BrzMxla74ZBh47CuZMmkYeKlMbo/S+MeYRK2S/FUu5c3w7MX0/SO6qMnrv8xSmdVTMlZr3d4GGqrmx2MtXR6aKcfEHg6X6MpyzqZkpMa38SSJyi+p5c9BM6+8V+cvL3xdA2A2peQP4Fy6unUyfKAWfnQ3RweRISs7xkbkMKTWXfuQpHpvyjNnbqjm1J8kKIq4cqbkLde9sv3BwTs64XlslA73he6Tn0dQEJfsSzCTmHjggalD7CU7o7YY29M4Mf2SQzdE1Mn+07Nh1Wng==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JUtwmQtX4LuhUS3olBX69lGkp2gQuXGjbOZ/XfsNnWELtX5j8Z984zMRA2Q5CySsgBCad8tyBGp+UEVzykbOObfI3MVcl1bKcQfHxae69yonY7V3BhGg/Cfj+TMpIxl4i3HScldRwC0rDxrCPBXs0VXWwpx07QmxmONsv8Hj4OrZ9zLvh8zs7b+NF3znRWSVhcdmo2P4G/eLGq+UqbpAMMsZ68CykRZYt3FLHfIP1+ShXMJR956q/rtZnsoUarFoRa8+aG7uK0741B5z3/pA7DJlBdggv875arqBsKnfw824oAIgKkAq8zbYNwcQoi3FyBpn8iyqfnsA4Rr8jSqhrA==
  • 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>, Henry Wang <Henry.Wang@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Wed, 27 Apr 2022 10:32:08 +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: AQHYWhk9pvmpyYf9yk6PCG0TATWN+q0DifWAgAAAvZCAAALDgIAAAKBg
  • Thread-topic: [PATCH v3 5/6] xen/arm: unpopulate memory when domain is static

Hi julien

> -----Original Message-----
> From: Julien Grall <julien@xxxxxxx>
> Sent: Wednesday, April 27, 2022 6:23 PM
> To: Penny Zheng <Penny.Zheng@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx
> Cc: Wei Chen <Wei.Chen@xxxxxxx>; Henry Wang <Henry.Wang@xxxxxxx>;
> Stefano Stabellini <sstabellini@xxxxxxxxxx>; Bertrand Marquis
> <Bertrand.Marquis@xxxxxxx>; Volodymyr Babchuk
> <Volodymyr_Babchuk@xxxxxxxx>; Andrew Cooper
> <andrew.cooper3@xxxxxxxxxx>; George Dunlap <george.dunlap@xxxxxxxxxx>;
> Jan Beulich <jbeulich@xxxxxxxx>; Wei Liu <wl@xxxxxxx>
> Subject: Re: [PATCH v3 5/6] xen/arm: unpopulate memory when domain is
> static
> 
> Hi Penny,
> 
> On 27/04/2022 11:19, Penny Zheng wrote:
> >>> +/*
> >>> + * 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) ({                   \
> >>> +    page_list_del(pg, page_to_list(d, pg));             \
> >>> +    if ( (pg)->count_info & PGC_reserved )              \
> >>> +        page_list_add_tail(pg, &(d)->resv_page_list);   \
> >>> +})
> >>> +#endif
> >>
> >> I am a bit puzzled how this is meant to work.
> >>
> >> Looking at the code, arch_free_heap_page() will be called from
> >> free_domheap_pages(). If I am not mistaken, reserved pages are not
> >> considered as xen heap pages, so we would go in the else which will
> >> end up to call free_heap_pages().
> >>
> >> free_heap_pages() will end up to add the page in the heap allocator
> >> and corrupt the d->resv_page_list because there are only one link list.
> >>
> >> What did I miss?
> >>
> >
> > In my first commit "do not free reserved memory into heap", I've
> > changed the behavior for reserved pages in free_heap_pages()
> > +    if ( pg->count_info & PGC_reserved )that
> > +        /* Reserved page shall not go back to the heap. */
> > +        return free_staticmem_pages(pg, 1UL << order, need_scrub);
> > +
> 
> Hmmm... somehow this e-mail is neither in my inbox nor in the archives on
> lore.kernel.org.
> 

Oh.... I just got email from tessian that they held my first commit, and needed 
my
confirmation to send. So sorry about that!!!

I'll re-send my first commit ASAP.

> Cheers,
> --
> Julien Grall

 


Rackspace

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