[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 1/6] xen: do not free reserved memory into heap
- To: Penny Zheng <Penny.Zheng@xxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Thu, 5 May 2022 09:42:20 +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=H+7/WrkTa+pkAfbx4Jft+s4DtAVkSGAzAFhBNOuODXg=; b=Rj3rbBskq4oO8QexP0S9uWnEBkP7m3nhf785t3clb4NP1A24UX9se1GNQyRTww0Y42haM+TkzfmMocWYYNmAWsw0KalVUyZC22Y1Khn3QLXjsjRbC6b0vmgIQma534iCju3iyx+cZcNyneBztpegGXNeNiIein4Zq+JGvgSZujg8o4BP0LMeOQvcgtcNK8ot9tzprRd/3gRdU8l0gNTwS4f+a3Wu7uKlUd5EWhOUIstE1fEI172capu15RW1luoPA1+s0nHDx2wZkMgNCtUVQODG6VSUXi/PUditRmE/qMpziouoXb8nLy06Xhe7UOgV69Ps6xxmhqsV3yZHeKVorQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dr+TRpfk4o0VRBLn7dqyOqYSgWK5dlqBePRTd/kQHqyBZ0eVd0W+E4itRyfgcBoKNyTZ7TXgbZE2VTm1AKkvxiqBkiQp82Mef+9O+2lrYKcQGNNgpsc7H4/R9WGQPcC/KmLbv8XwdAwV1szp8NThB+TNmzaJa+6ZX0ABfyKBAlwjCg+CC0YuMQOrf7VbDRUEc2SfsIee3Ute+oUxCozmbM/dXW51MQwJFA2zcTfLzgMqUPcONH4OzslF+tFLGXpLsn27daMqEXGEE4xGlDATPoIBb11a0u/czQPivCucVG+j3bLznaBfFjIHWJFHp7DVjrv/T6nDuc6Z6XaR7PFayg==
- 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: Thu, 05 May 2022 07:42:30 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 05.05.2022 07:12, Penny Zheng wrote:
> Hi jan
>
>> -----Original Message-----
>> From: Jan Beulich <jbeulich@xxxxxxxx>
>> Sent: Wednesday, May 4, 2022 9:27 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 v3 1/6] xen: do not free reserved memory into heap
>>
>> On 28.04.2022 05:01, Penny Zheng wrote:
>>> --- a/xen/common/page_alloc.c
>>> +++ b/xen/common/page_alloc.c
>>> @@ -1443,6 +1443,10 @@ static void free_heap_pages(
>>>
>>> ASSERT(order <= MAX_ORDER);
>>>
>>> + if ( pg->count_info & PGC_reserved )
>>> + /* Reserved page shall not go back to the heap. */
>>> + return free_staticmem_pages(pg, 1UL << order, need_scrub);
>>
>> With PGC_reserved being zero, the compiler should CSE this call. Hence ...
>>
>
> I assume that you suggest that we remove the stub function and just let
> free_staticmem_pages not guarded by CONFIG_STATIC_MEMORY any more?
No, I' not suggesting to remove the existing guard. I'm only suggesting
to avoid introducing a stub when that's not really needed.
> Hmmmm, on x86, PGC_reserved will be zero as not defined, and CSE will leave
> no caller here. but on arm, CSE could not guard this?
Why would that be? When !CONFIG_STATIC_MEMORY, I'd expect PGC_reserved
to be zero on Arm as well.
Jan
|