mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
x86/PoD: skip eager reclaim when possible
Reclaiming pages is pointless when the cache can already satisfy all outstanding PoD entries, and doing reclaims in that case can be very harmful to performance when that memory gets used by the guest, but only to store zeroes there. Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com> Release-acked-by: Wei Liu <wei.liu2@citrix.com> Reviewed-by: George Dunlap <george.dunlap@citrix.com>
This commit is contained in:
1 parent
744fe0347d
commit
556c69f4ef
1 file changed
+3
-2
@@ -1031,7 +1031,6 @@ static void pod_eager_record(struct p2m_domain *p2m,
|
||||
{
|
||||
struct pod_mrp_list *mrp = &p2m->pod.mrp;
|
||||
|
||||
ASSERT(mrp->list[mrp->idx] == INVALID_GFN);
|
||||
ASSERT(gfn != INVALID_GFN);
|
||||
|
||||
mrp->list[mrp->idx++] =
|
||||
@@ -1079,7 +1078,9 @@ p2m_pod_demand_populate(struct p2m_domain *p2m, unsigned long gfn,
|
||||
return 0;
|
||||
}
|
||||
|
||||
pod_eager_reclaim(p2m);
|
||||
/* Only reclaim if we're in actual need of more cache. */
|
||||
if ( p2m->pod.entry_count > p2m->pod.count )
|
||||
pod_eager_reclaim(p2m);
|
||||
|
||||
/* Only sweep if we're actually out of memory. Doing anything else
|
||||
* causes unnecessary time and fragmentation of superpages in the p2m. */
|
||||
|
||||