[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH v9 6/8] xen/arm: unpopulate memory when domain is static
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Penny Zheng <Penny.Zheng@xxxxxxx>
- Date: Tue, 26 Jul 2022 02:57:42 +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=EsSUfY5+XGWTbio/dwOVcg6/hGZYnAsP/J3Vbi1MDLI=; b=oCgRXqU1rusUCXZZwQXwFhj/FgJwaSrxL5suW7M0BQHPuh7Kjh82J8zNAz4Km/9Sm2Sf2SWDDDCjneYMDyF9Cfz6rli3tWYvSInassBuOwKOQJQYOiojnW763RcjwZr/DRUjunZJ7fWER5URbPwORIOVNKNtG5PW2Eo0PVHjekvIEjbNhR3lyrhqx7TzhK+RvBN5pWiAvSt6VMHt75CX0DzkpfpWwyH3uu4sDWe0a+XPxNvuYmG9CE08gK7NqGJIMF8IKhIvpA4sYUAX3+AJvyeqjq8rMuEgUVCjm6JlEqxsoKPQhRav4u25y/8HWGeJzTBtdahhFt6UU6AF7IyTTA==
- 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=EsSUfY5+XGWTbio/dwOVcg6/hGZYnAsP/J3Vbi1MDLI=; b=YhMozm/0HWzeeGhM8lKCksutQsJmtYIKIEpZWWlUc+YIHovvJUfujAKBvLpmNx0LIAIo9oNmITQBpJ4hAWHZsRh0or2xn2lTTqnnMi/5Sby8OO4yRk48+3V4wAP1yqHrdttRrZWLWcLGc9saOl6kwq4+8pLhARwl0/0jrbBAyko1UI7VoqNvIouiYqRUVryFUU0TjqaukMViMAcQ63owK4XDB3EqkybytzstvDeB8K7BJ5imMFwq4+HWfmAlAkLcec1vWJfLloB2pHoTFktf6yc32+9ewxzzPUnP5oRLfvaGBeBSqJ6HHcW3nWd6/o5liTrsTYLfxdThvb5omy5DiA==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=SOQUyUpLGZflfDdJoX3E50wDi/BacDiGMW78p9zU8NSkjFWC80G1OsyQhROJvdeFHW1XpIO2S2j3N8GdPTa9B9ZpsRO9IrwTKVaPq1k7XqZgvnLmK6Fapq5Tk+nR4gyeQp7TWqyv03e+OlXNYPKndio2PvvsW89wN3HiZ2DUptdd5vbnm+g6LsTfw1Y7UVtG93awmiQQFkJI3YOScjRpZheSWOHjEKoptx6eN7X5AYEH3MO5LtVlYtN0Kon8ZJ+Au1S2VrNsTnBsczgxilaqO7+RQczYS3l0Sa0QbEBI9BL8NWYNSa6zb0yBBuC575vk7RtQHHhtHKfa12zMeNdu0A==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jnVL9raBaRyBhy7YJ+ITeSYVqUDstN3bm0r35aK3f/dgCKkyfvpDaSsWQkM+LondPEPH9Ul6LVHvEkeSz7RLuLUP3IkRuYsU4x7eh0XiNvgmUX954AiSAmwZcargSL0VWaZ5eb75rH/S3ZbsI3M/OR2+5+3Y0hOCyKASM/B65HvXqT0R0zv23uLV2b0Si1A6IiNiEX9tFIl2HXnCOjrqozCOAFlxzBSqBnkj+B1Am0ymJEaZ6kEP/234y9LC2/N8GtUeLZ9IXTQlFdkHElp3ISKbq0mYs8R2Au9hjbEJv14kjRphUlyGdVKIa6RBP1t3QOgFAbRKqpPLcH9YJU4X1g==
- 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: Tue, 26 Jul 2022 02:58:25 +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: AQHYm/wj+C+KkWoRC0CF4EH9AdaBLK2PQF8AgAC9HgA=
- Thread-topic: [PATCH v9 6/8] xen/arm: unpopulate memory when domain is static
Hi Jan
> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: Monday, July 25, 2022 11:36 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 v9 6/8] xen/arm: unpopulate memory when domain is
> static
>
> On 20.07.2022 07:46, Penny Zheng wrote:
> > Today when a domain unpopulates the memory on runtime, they will
> > always hand the memory back to the heap allocator. And it will be a
> > problem if domain is static.
> >
> > Pages as guest RAM for static domain shall be reserved to only this
> > domain and not be used for any other purposes, so they shall never go
> > back to heap allocator.
> >
> > This commit puts reserved pages on the new list resv_page_list only
> > after having taken them off the "normal" list, when the last ref dropped.
>
> I guess this wording somehow relates to ...
>
> > --- a/xen/common/page_alloc.c
> > +++ b/xen/common/page_alloc.c
> > @@ -2674,10 +2674,14 @@ void free_domstatic_page(struct page_info
> > *page)
> >
> > drop_dom_ref = !domain_adjust_tot_pages(d, -1);
> >
> > - spin_unlock_recursive(&d->page_alloc_lock);
> > -
> > free_staticmem_pages(page, 1, scrub_debug);
> >
> > + /* Add page on the resv_page_list *after* it has been freed. */
> > + if ( !drop_dom_ref )
> > + page_list_add_tail(page, &d->resv_page_list);
>
> ... the conditional used here. I cannot, however, figure why there is this
> conditional (and said part of the description also doesn't help me figure it
> out).
>
I was thinking that if drop_dom_ref true, then later the whole domain struct
will be released, then there is no need to add the page to d->resv_page_list
> As an aside: A title prefix of xen/arm: suggests you're mostly touching Arm
> code. But you're touching exclusively common code here.
> I for one would almost have skipped this patch (more than once) when
> deciding which ones (may) want me looking at them.
>
Sorry for that, I’ll fix it
> Jan
|