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

Re: [PATCH 07/10] xen/arm: intruduce alloc_domstatic_pages



Hi Penny,

On 18/05/2021 09:57, Penny Zheng wrote:
-----Original Message-----
From: Jan Beulich <jbeulich@xxxxxxxx>
Sent: Tuesday, May 18, 2021 3:35 PM
To: Penny Zheng <Penny.Zheng@xxxxxxx>
Cc: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>; Wei Chen
<Wei.Chen@xxxxxxx>; nd <nd@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx;
sstabellini@xxxxxxxxxx; julien@xxxxxxx
Subject: Re: [PATCH 07/10] xen/arm: intruduce alloc_domstatic_pages

On 18.05.2021 07:21, Penny Zheng wrote:
--- a/xen/common/page_alloc.c
+++ b/xen/common/page_alloc.c
@@ -2447,6 +2447,9 @@ int assign_pages(
      {
          ASSERT(page_get_owner(&pg[i]) == NULL);
          page_set_owner(&pg[i], d);
+        /* use page_set_reserved_owner to set its reserved domain owner.
*/
+        if ( (pg[i].count_info & PGC_reserved) )
+            page_set_reserved_owner(&pg[i], d);

Now this is puzzling: What's the point of setting two owner fields to the same
value? I also don't recall you having introduced
page_set_reserved_owner() for x86, so how is this going to build there?


Thanks for pointing out that it will fail on x86.
As for the same value, sure, I shall change it to domid_t domid to record its 
reserved owner.
Only domid is enough for differentiate.
And even when domain get rebooted, struct domain may be destroyed, but domid 
will stays
The same.
Major user cases for domain on static allocation are referring to the whole 
system are static,
No runtime creation.

One may want to have static memory yet doesn't care about the domid. So I am not in favor to restrict about the domid unless there is no other way.

Cheers,

--
Julien Grall



 


Rackspace

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