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

[PATCH V2 0/6] populate/unpopulate memory when domain on static


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Mon, 18 Apr 2022 20:22:45 +0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); 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=0jEisy1eATjqY9YTsVOUYfJAJGD5K6BvzhFoHMEHvwc=; b=SnUfKrv6eu7bgl2oSQ1tRSBMOJJ6lRC2Jrl7PrEHkdP2qrJGI4FisRn4ccrTbNkp1IOar4OqS2Xv2euRCiSX2ECQhWjUPwY1rXOSvEEyGBQvRA2DOvMkR3pZwADaXXlG+aVn/ApsdvW2Xfx31MGjCkPXpqYcKRPOr78G1rKoURPQQpK6d7Z1WQgsjIPo7rWKh0Jg93oFp1T/KN/lzhDB8AWjTGNGkFiPnYKrJQMIsNmQ8NHiq0LP8EEfF9ADg0FqIL5tQ6+9Sne37gRbnUGbtbKAHFQmFQQVfFde9AEmj8jj/0PHEttKy8mvpAvntNDSAVW0ib8bc+C/Y6XZKzHXsw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aFpVpHDXLh79SvgSwqlheMNes2IiWkmVApWwBntPZeWiydOhQ+i7V9R3QvCs+aCniK9YL0aHFAG4tU1ixyoYl04RWBc5YDyNM1s+29ifCoDk8OztJL+OwakHo7O99LAx+BtibUqwyGgJHmbfYpihiiNfuk8GCme0/WtA9Gzx45meVKovbYczV999OWJl+3qIL3/QP7BIeVXXWQKHuX63K661Poiiw91GKzo8ATvG3kBme61rV41uNVJKwkBwi7A2FH1vouMw7Pas+iDnF/Jv9sN18iuUl6BuLk0PBWPY8I/LBiZ21Khvk3IjTkS/7frbpnZ1HiEynqIlhe5kLQTqOw==
  • Cc: <wei.chen@xxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, "Jan Beulich" <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 18 Apr 2022 12:23:40 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true

Today when a domain unpopulates the memory on runtime, they will always
hand the memory over to the heap allocator. And it will be a problem if it
is a static domain. Pages as guest RAM for static domain shall always be
reserved to only this domain and not be used for any other purposes, so
they shall never go back to heap allocator.

This patch serie intends to fix this issue, by adding pages on the new list
resv_page_list after having taken them off the "normal" list, when unpopulating
memory, and retrieving pages from resv page list(resv_page_list) when
populating memory.

---
v2 changes:
- let "flags" live in the struct domain. So other arch can take
advantage of it in the future
- change name from "is_domain_on_static_allocation" to "is_domain_static()"
- put reserved pages on resv_page_list after having taken them off
the "normal" list
- introduce acquire_reserved_page to retrieve reserved pages from
resv_page_list
- forbid non-zero-order requests in populate_physmap
- let is_domain_static return ((void)(d), false) on x86
- fix coding style

Penny Zheng (6):
  xen/arm: do not free reserved memory into heap
  xen/arm: do not merge reserved pages in free_heap_pages()
  xen: add field "flags" to cover all internal CDF_XXX
  xen/arm: introduce CDF_staticmem
  xen/arm: unpopulate memory when domain is static
  xen/arm: retrieve reserved pages on populate_physmap

 xen/arch/arm/domain.c             |  2 --
 xen/arch/arm/domain_build.c       |  5 +++-
 xen/arch/arm/include/asm/domain.h |  5 ++--
 xen/arch/arm/include/asm/mm.h     | 17 +++++++++++++
 xen/common/domain.c               |  7 ++++++
 xen/common/memory.c               | 29 ++++++++++++++++++++++
 xen/common/page_alloc.c           | 40 +++++++++++++++++++++++++++++--
 xen/include/xen/domain.h          |  2 ++
 xen/include/xen/mm.h              |  1 +
 xen/include/xen/sched.h           |  9 +++++++
 10 files changed, 110 insertions(+), 7 deletions(-)

-- 
2.25.1




 


Rackspace

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