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

Re: [PATCH 2/2] xen/arm: Handle reserved heap pages in boot and heap allocator


  • To: Henry Wang <Henry.Wang@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Michal Orzel <michal.orzel@xxxxxxx>
  • Date: Tue, 30 Aug 2022 11:48:45 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=arm.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); 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=Ofcfttb8+Pa2a7ub3k0u3yB3GduxZw7r79l28QaPOsw=; b=W6jQ6y52WFwUuBeX+SMZ0ZbWtFRIsiStAQ0S8jFooZHIGqlWoyuxuf7IeXjI4VtIW88BUaLjGc0p34BN21+qSnSOrlVuapZqBZkdQB5GCKijlbbYcfeIOYG86LiLfoItzU2NhgUoBy7u4vGZkZIt2DUHzvaEgY/zWSj7ZFBy1Wp8jq/OwggpunVfGyn48m4zVWGbvlDx+n0GrSeh8umsugtq6L2gJ1OrLI5R2Wd0etPBOzGNW17a/r0xhQ6nV3r5Kpu5Wl9BtARRwtZYbMuHxCDzR3zL035jqsnYeYfOHxxy66mUzwYb8eYn+XNCw7BFfo0ntXqaExy2Wun8riVumQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=R6rZDBkpec6AanfOVIRGe8FMLGh0iBSRPUSNpMgc/iNkbNrvISHRStv64GW5HF/o8JW4dVnyiM7UYEJhdGqGt157D5Yf/uv/eHKT5OnMp7c//mNAj4oC1xW4zf2Z3ylF5N2NRwmout6loSSJy8jFydKqwFqr6GPlA6pc3/pG2adZ4Cohbn4Zu1NnewFYNyP/sr8I1KguHMExD+dFp9896F1AydjH1ysxSrk7mCaNQsccVoWB+gGiR9z4ZcXES4EgauFsY7FCARDkwn06zcwfCEdElwR+hHIQheeVmJZpSbdwg3qA2+F1sVWLAXEHunlGtFmioNYWOlnXNQKsz/NIXA==
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Tue, 30 Aug 2022 09:49:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 30/08/2022 11:17, Henry Wang wrote:
> 
> Hi Michal,
> 
>> -----Original Message-----
>> From: Michal Orzel <michal.orzel@xxxxxxx>
>>>> This is totally fine. What I mean is that the check you introduced does not
>>>> correspond
>>>> to the panic message below. In case of reserved heap, its size is selected
>> by
>>>> the user.
>>>> "Not enough space for xenheap" means that there is not enough space to
>> be
>>>> reserved for heap,
>>>> meaning its size is too large. But your check is about size being too 
>>>> small.
>>>
>>> Actually my understanding of "Not enough space for xenheap" is xenheap
>>> is too large so we need to reserve more space, which is slightly different
>> than
>>> your opinion. But I am not the native speaker so it is highly likely that I 
>>> am
>>> making mistakes...
>> My understanding is exactly the same as yours :),
>> meaning heap is too large.
> 
> Oh I think get your point. Let me try to explain myself and thanks for your
> patience :))
> 
> The reserved heap region defined in the device tree should be used for both
> Xenheap and domain heap, so if we reserved a too small region (<32M),
> an error should pop because the reserved region is not enough for xenheap,
> and user should reserve more.
> [...]
> 
>> But your check is against heap being to small (less than 32M).
>> So basically if the following check fails:
>> "( reserved_heap && reserved_heap_pages < 32<<(20-PAGE_SHIFT) ) )"
>> it means that the heap region defined by a user is too small (not too large),
>> because according to requirements it should be at least 32M.
> 
> [...]
> So in that case, printing "Not enough space for xenheap" means the reserved
> region cannot satisfy the minimal requirement of the space of xenheap (at 
> least
> 32M), and this is in consistent with the check.

Ok, it clearly depends on the way someone understands this sentence.
Currently this panic can be triggered if the heap size is too large and
should be read as "heap is too large to fit in because there is not enough space
within RAM considering modules (e - s < size)". Usually (and also in this case)
space refers to a region to contain another one.

You are reusing the same message for different meaning, that is "user defined 
too
small heap and this space (read as size) is not enough".

Let's leave it to someone else to decide.

~Michal



 


Rackspace

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