|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v2 3/3] xen/heap: pass order to free_heap_pages() in heap init
Hi Jan, On 18/07/2022 10:43, Jan Beulich wrote: On 15.07.2022 19:03, Julien Grall wrote:@@ -1806,8 +1806,22 @@ static void _init_heap_pages(const struct page_info *pg,while ( s < e ) MAX_ORDER, flsl(), ffsl() are both returning signed value. So inc_order should be 'int' to avoid any compilation issue. + if ( s ) + inc_order = min(inc_order, ffsl(s) - 1); + free_heap_pages(mfn_to_page(_mfn(s)), inc_order, need_scrub);... that's what the function parameter says, and the value also can go negative? AFAICT, none of the values are negative. But per above, if we use min() then the local variable should be 'int'. The two possible alternatives are: 1) Use min_t() 2) Update MAX_ORDER, flsl(), ffsl() to return an unsigned valueThe ideal would be #2 but it will require at least an extra patch and effort. If we use #1, then they use may become stale if we implement #2. So I would prefer to keep min(). That said, I would be open to use min_t() if you strongly prefer it. Preferably with these adjustments Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx> Thanks! Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |