|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v3 4/8] xen/arm: introduce put_page_nr and get_page_nr
On 13/05/2022 03:22, Penny Zheng wrote: Hi Julien Hi Penny, -----Original Message----- From: Julien Grall <julien@xxxxxxx> Sent: Thursday, May 12, 2022 6:14 PM To: Penny Zheng <Penny.Zheng@xxxxxxx>; xen-devel@xxxxxxxxxxxxxxxxxxxx Cc: Wei Chen <Wei.Chen@xxxxxxx>; Stefano Stabellini <sstabellini@xxxxxxxxxx>; Bertrand Marquis <Bertrand.Marquis@xxxxxxx>; Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx> Subject: Re: [PATCH v3 4/8] xen/arm: introduce put_page_nr and get_page_nr On 12/05/2022 10:11, Penny Zheng wrote:Later, we need to add the right amount of references, which should be the number of borrower domains, to the owner domain. Since we only have get_page() to increment the page reference by 1, a loop is needed per page, which is inefficient and time-consuming. To save the loop time, this commit introduces a set of new helpers put_page_nr() and get_page_nr() to increment/drop the page reference bynr.Signed-off-by: Penny Zheng <penny.zheng@xxxxxxx> --- v3 changes: - check overflow with "n" - remove spurious change - bring back the check that we enter the loop only when count_info is greater than 0 --- v2 change: - new commit --- xen/arch/arm/include/asm/mm.h | 4 ++++ xen/arch/arm/mm.c | 36 ++++++++++++++++++++++++++--------- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/xen/arch/arm/include/asm/mm.h b/xen/arch/arm/include/asm/mm.h index 424aaf2823..c737d51e4d 100644 --- a/xen/arch/arm/include/asm/mm.h +++ b/xen/arch/arm/include/asm/mm.h @@ -347,6 +347,10 @@ void free_init_memory(void); int guest_physmap_mark_populate_on_demand(struct domain *d,unsigned long gfn,
Both option should catch the overflow. In option 1, this was 2 part check:
if ( nr >= PGC_count_mask )
...
do
{
if ( unlikely((x + nr) & PGC_count_mask <= n )
return NULL;
...
} while (...);
Cheers,
--
Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |