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

Re: [PATCH v4 1/6] xen: do not free reserved memory into heap


  • To: Julien Grall <julien@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 17 May 2022 18:07:38 +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=BEP/oERyYYK8Ui+6e0nWabj/WNxIr1Uz8aYLVSV9mZA=; b=LDrXGakaoqm4zjItv3niadO++sIpLSnqFUNQts1XrE5mKZkjxcpFT/dmsxqI9aD7S5Dn60RePwXkB6PzbmnEAZGbS6eF5HeIOdLC5j71Mk1xd89jJSpMxkGT1CAaLOBIAF6JRPWAcB90/hDXPBlmOAL8bU8lr3K1tXHrCCLKqTG8RkLsI356RawWzwPqOKU1wzuNotIXhD9L9G1bMYGte8sS5yDj5CyPAz3qn9TLwZGZBI+Rxct16R4vuxnrYfSggCt4+WmhGv5+CL2FyzIfF0Hp25K7rdES78gJrZIryUBWvFHqXCIE0KHDlLosw80DsNMyWMlxZhlcWZmYhd/iWQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WvYxbijBYqyPKO6NaR9X1RRyncHsu9KbClcBIOIPD8tgCQWdQWarzUutFyviyg6wMQzeguSzd2ARO25kJWZ6qFRVF8z4BAtLe+btlyjYR8znjNvgdd063mYypU0EHIh810ADaYSeUd/dmvBFTiRAZ28wz7FWdj+U8SpL+Gh/wolTPUq4hcxKSsW+XgPSXz6w5RI0FRS0f16LJZZrTrSKTHesPrXBoXqpRDbYYh+414gHUEIl2jFYzWwcjr95iiRuY3OQI01QgK5YaxpcGPDh8PZMF7u1ZUQPqohM4czYbQQg1chCEo94ZBivV2LZzRGlChMWarfiD2riX/5IXqJiew==
  • 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>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>
  • Delivery-date: Tue, 17 May 2022 16:07:42 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 17.05.2022 11:28, Julien Grall wrote:
> On 17/05/2022 09:21, Penny Zheng wrote:
>>>> @@ -2653,7 +2657,8 @@ void __init free_staticmem_pages(struct page_info
>>> *pg, unsigned long nr_mfns,
>>>>            }
>>>>
>>>>            /* In case initializing page of static memory, mark it 
>>>> PGC_reserved. */
>>>> -        pg[i].count_info |= PGC_reserved;
>>>> +        if ( !(pg[i].count_info & PGC_reserved) )
>>>
>>> NIT: I understand the flag may have already been set, but I am not 
>>> convinced if
>>> it is worth checking it and then set.
>>>
>>
>> Jan suggested that since we remove the __init from free_staticmem_pages, 
>> it's now in preemptable
>> state at runtime, so better be adding this check here.
> 
> Well, count_info is already modified within that loop (see 
> mark_page_free()). So I think the impact of setting PGC_reserved is 
> going to be meaningless.
> 
> However... mark_page_free() is going to set count_info to PGC_state_free 
> and by consequence clear PGC_reserved. Theferore, in the current 
> implementation we always need to re-set PGC_reserved.

Oh, indeed - I didn't pay attention to that aspect. Which then, however,
means that the comment also wants adjusting.

Jan

> So effectively, the "if" is pointless here.
> 
> Cheers,
> 




 


Rackspace

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