[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] xen/arm: Workaround for memory problem >1gb on last section
setup_xenheap_mappings setup head memory on Arm 32 has a limit of 1gb. On system with large memory is possible that there are no blocks of memory smaller than 1gb leading xenheap_pages to be more than 1gb. This cause memory errors trying to access heap after the 1gb limit. Signed-off-by: Frediano Ziglio <frediano.ziglio@xxxxxxxxxx> --- xen/arch/arm/setup.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 446de8a..e223d1b 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -509,6 +509,7 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size) heap_pages = ram_pages; xenheap_pages = (heap_pages/8 + 0x1fffUL) & ~0x1fffUL; xenheap_pages = max(xenheap_pages, 128UL<<(20-PAGE_SHIFT)); + xenheap_pages = min(xenheap_pages, 1UL<<(30-PAGE_SHIFT)); do { -- 1.9.1 I think you mean something like this. Tested and work on my board. It's mostly the same code put before the loop instead of after. As there are already some fixes like this I agree that before is better (more consistent). Frediano 2014-10-02 12:03 GMT+01:00 Julien Grall <julien.grall@xxxxxxxxxx>: > Hello Frediano, > > On 10/01/2014 03:27 PM, Frediano Ziglio wrote: >> setup_xenheap_mappings setup head memory on Arm 32 has a limit of 1gb. >> On system with large memory is possible that there are no blocks of memory >> smaller than 1gb leading xenheap_pages to be more than 1gb. >> This cause memory errors trying to access heap after the 1gb limit. >> >> Signed-off-by: Frediano Ziglio <frediano.ziglio@xxxxxxxxxx> >> --- >> xen/arch/arm/setup.c | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c >> index 446de8a..b1a43e6 100644 >> --- a/xen/arch/arm/setup.c >> +++ b/xen/arch/arm/setup.c >> @@ -524,6 +524,9 @@ static void __init setup_mm(unsigned long >> dtb_paddr, size_t dtb_size) >> if ( ! e ) >> panic("Not not enough space for xenheap"); >> >> + if ( xenheap_pages > 1<<(30-PAGE_SHIFT) ) >> + xenheap_pages = 1<<(30-PAGE_SHIFT); >> + > > Looking closer to the code, can't we add a new constraint before the > loop when we are looking for the maximum heap size? > > smth like: > > xenheap_pages = (heap_pages/8 + ...) > xenheap_pages = max(xenheap_pages, 128UL<<(20 - PAGE_SHIFT) > xenheap_pages = max(xenheap_pages, 1UL<<(30-PAGE_SHIFT)) > > Regards, > > -- > Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |