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

Re: [PATCH] memory: avoid pointless continuation in xenmem_add_to_physmap()

Hi Jan,

On 04/12/2020 10:43, Jan Beulich wrote:
Adjust so we uniformly avoid needlessly arranging for a continuation on
the last iteration.

Fixes: 5777a3742d88 ("IOMMU: hold page ref until after deferred TLB flush")

I view this patch as an optimization because there is nothing wrong with the code. So I think "Fixes" is not entirely suitable here.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Other than my remark about the tag:

Reviewed-by: Julien Grall <jgrall@xxxxxxxxxx>


--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -854,8 +854,9 @@ int xenmem_add_to_physmap(struct domain
/* Check for continuation if it's not the last iteration. */
-        if ( (++done >= ARRAY_SIZE(pages) && extra.ppage) ||
-             (xatp->size > done && hypercall_preempt_check()) )
+        if ( xatp->size > ++done &&
+             ((done >= ARRAY_SIZE(pages) && extra.ppage) ||
+              hypercall_preempt_check()) )
              rc = start + done;

Julien Grall



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