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

Re: [PATCH v9 8/8] xen: retrieve reserved pages on populate_physmap


  • To: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 12 Aug 2022 13:08:05 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; 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=WwiCXNhylA79WLyOxDZn0OgicSVqUfhyODZ5kPzLKe4=; b=TCF9DqXg/WKjuyj7rkmoDbe6Na8Zs+rR4Thr7Adiu+6NPxSMVELpzpgPEaQooHb4qQF1e6/VRDuT2b3KV5MadQlwQj5IY6eIvMNGun2RG9ZS/p3OJ9KEdXBtvHU5lVNL+6sdA18oBY7t2W5Gvj3RCIvfMkfrdqxl+8NvLvTSaBU53DP9kA4OYzoCcV0otvliWmIslZRyD+uTV1ptxt3RNngPtgPox172iC+VgNdqA1jut77iIQhkFzbRf8iUcJcbJplJqprokKJ1UEoCDMEWLpVso4ib9QYjCNwM0hmD65TdsqeZUjTqAIlwJC0Qn4Up1qqDrbiy7duP6qRndt4rYg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LXe4kLZyyWURuzZcQYuqgVrA31y+1yt0lQDPCBYUmva5dBUyZbrZXJ6j5NrgMcfQN397A1lKHp/OXPDP6v5FZm7PgB50D1pdILqccCHj6MT/vsqSxM799A7XdJd3gt9ndk0vtXrN4MgYJs8pGDDOaCotGkePDGFlag5hHNH4w8Gf2JMWnVNseFakUyYbvz/RnpEmXjVPnsI7o9vA2S/o5LlvNorXyxLgHIrwuljqNZmyBKesF69UkHYOHQSwKltHPQttMaU8Ns9wmpBNqsiwMd+iSNrJ4jZqSi/Ds8oPaWE4PJgDMT8TrgM8Oxq9SQXfqjjFEklCJKcwM47v5vsEhQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.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: Fri, 12 Aug 2022 11:08:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 12.08.2022 11:53, Bertrand Marquis wrote:
>> On 9 Aug 2022, at 09:58, Penny Zheng <Penny.Zheng@xxxxxxx> wrote:
>>> -----Original Message-----
>>> From: Jan Beulich <jbeulich@xxxxxxxx>
>>> Sent: Tuesday, August 9, 2022 4:27 PM
>>>
>>> On 09.08.2022 10:07, Penny Zheng wrote:
>>>>> -----Original Message-----
>>>>> From: Jan Beulich <jbeulich@xxxxxxxx>
>>>>> Sent: Tuesday, August 9, 2022 3:59 PM
>>>>>
>>>>> On 09.08.2022 09:53, Penny Zheng wrote:
>>>>>>> -----Original Message-----
>>>>>>> From: Xen-devel <xen-devel-bounces@xxxxxxxxxxxxxxxxxxxx> On Behalf
>>>>>>> Of Jan Beulich
>>>>>>> Sent: Monday, July 25, 2022 11:44 PM
>>>>>>>
>>>>>>> On 20.07.2022 07:46, Penny Zheng wrote:
>>>>>>>> When a static domain populates memory through populate_physmap
>>> at
>>>>>>>> runtime, it shall retrieve reserved pages from resv_page_list to
>>>>>>>> make sure that guest RAM is still restricted in statically
>>>>>>>> configured memory
>>>>>>> regions.
>>>>>>>> This commit also introduces a new helper acquire_reserved_page to
>>>>>>>> make
>>>>>>> it work.
>>>>>>>>
>>>>>>>> Signed-off-by: Penny Zheng <penny.zheng@xxxxxxx>
>>>>>>>> ---
>>>>>>>> v9 changes:
>>>>>>>> - Use ASSERT_ALLOC_CONTEXT() in acquire_reserved_page
>>>>>>>> - Add free_staticmem_pages to undo prepare_staticmem_pages when
>>>>>>>> assign_domstatic_pages fails
>>>>>>>
>>>>>>> May I suggest to re-consider naming of the various functions?
>>>>>>> Undoing what "prepare" did by "free" is, well, counterintuitive.
>>>>>>>
>>>>>>
>>>>>> How about change the name "prepare_staticmem_pages" to
>>>>> "allocate_staticmem_pages"?
>>>>>
>>>>> Perhaps - if what the function does really resembles allocation in some
>>> way.
>>>>> So far I wasn't really certain in that regard, and hence I was
>>>>> wondering whether "prepare" doesn't better describe what it does, but
>>>>> then its inverse also doesn't really "free" anything.
>>>>>
>>>>
>>>> Hmmmm, “prepare” with “destroy” in its inverse? Do you have any
>>> suggestion in mind?
>>>
>>> To be honest I was hoping you would make an attempt at finding a suitable
>>> pair of verbs. To me "destroy" is more the opposite of "create", and I'm
>>> unable to think of a good opposite of "prepare" (short of resorting to
>>> "unprepare"); if I really needed to come up with something then it would
>>> likely be "cleanup", albeit I'd not be overly happy with that either.
>>>
>>
>> Maybe unprepare is better here, I was searching linux code for the help, and
>> they are using prepare/unprepare as a pair of verbs a lot in drivers codes.
>>
>> For the renaming here, I suggest to fix it with a new commit, since 
>> free_staticmem_pages
>> has already been merged.
> 
> I think that unprepare is ok and it make sense to do this in an independent 
> patch.
> 
> @jan: can you confirm that you agree with this way to go ?

I don't mind this, yes.

Jan



 


Rackspace

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