paged_pages field is MEM_PAGING-only
authorJan Beulich <jbeulich@suse.com>
Fri, 8 Apr 2022 12:48:45 +0000 (14:48 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 8 Apr 2022 12:48:45 +0000 (14:48 +0200)
Conditionalize it and its uses accordingly.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Tamas K Lengyel <tamas@tklengyel.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
xen/arch/x86/mm/mem_sharing.c
xen/arch/x86/mm/p2m.c
xen/common/domctl.c
xen/common/keyhandler.c
xen/include/xen/sched.h

index 703b1c06dc77cff82d3d7501e5fb8797bd73fca1..a5c16b4429e6dc05dc28b2fb8530f83494e3808a 100644 (file)
@@ -1213,6 +1213,7 @@ int add_to_physmap(struct domain *sd, unsigned long sgfn, shr_handle_t sh,
     }
     else
     {
+#ifdef CONFIG_MEM_PAGING
         /*
          * There is a chance we're plugging a hole where a paged out
          * page was.
@@ -1238,6 +1239,7 @@ int add_to_physmap(struct domain *sd, unsigned long sgfn, shr_handle_t sh,
                 put_page(cpage);
             }
         }
+#endif
     }
 
     atomic_inc(&nr_saved_mfns);
index 6b73a5b632788bb5f0d4029b7364654e9f5bcb34..fb9d10b8207515ec5bb373d8accc6fe16e9d9753 100644 (file)
@@ -691,11 +691,13 @@ p2m_add_page(struct domain *d, gfn_t gfn, mfn_t mfn,
             /* Count how man PoD entries we'll be replacing if successful */
             pod_count++;
         }
+#ifdef CONFIG_MEM_PAGING
         else if ( p2m_is_paging(ot) && (ot != p2m_ram_paging_out) )
         {
             /* We're plugging a hole in the physmap where a paged out page was */
             atomic_dec(&d->paged_pages);
         }
+#endif
     }
 
     /* Then, look for m->p mappings for this range and deal with them */
index 540a03e075f0c348682be77a5351ce5bb405bf65..57135d4478718c4b145cdbad5b34d8be16a92854 100644 (file)
@@ -112,7 +112,9 @@ void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info)
 #ifdef CONFIG_MEM_SHARING
     info->shr_pages         = atomic_read(&d->shr_pages);
 #endif
+#ifdef CONFIG_MEM_PAGING
     info->paged_pages       = atomic_read(&d->paged_pages);
+#endif
     info->shared_info_frame =
         gfn_x(mfn_to_gfn(d, _mfn(virt_to_mfn(d->shared_info))));
     BUG_ON(SHARED_M2P(info->shared_info_frame));
index 256b394057464efc9784db56f5f929f3aae3ac95..ca9ee07901495ac27235e77a3be9a94559dcc5eb 100644 (file)
@@ -281,14 +281,18 @@ static void cf_check dump_domains(unsigned char key)
 #ifdef CONFIG_MEM_SHARING
                " shared_pages=%u"
 #endif
+#ifdef CONFIG_MEM_PAGING
                " paged_pages=%u"
+#endif
                " dirty_cpus={%*pbl} max_pages=%u\n",
                domain_tot_pages(d), d->xenheap_pages,
 #ifdef CONFIG_MEM_SHARING
                atomic_read(&d->shr_pages),
 #endif
-               atomic_read(&d->paged_pages), CPUMASK_PR(d->dirty_cpumask),
-               d->max_pages);
+#ifdef CONFIG_MEM_PAGING
+               atomic_read(&d->paged_pages),
+#endif
+               CPUMASK_PR(d->dirty_cpumask), d->max_pages);
         printk("    handle=%02x%02x%02x%02x-%02x%02x-%02x%02x-"
                "%02x%02x-%02x%02x%02x%02x%02x%02x vm_assist=%08lx\n",
                d->handle[ 0], d->handle[ 1], d->handle[ 2], d->handle[ 3],
index 18404b3c98b1c0fe59d41491bd1672b43704a0cb..ed8539f6d297c7cb8cd1e1d3f180853bfa953584 100644 (file)
@@ -392,7 +392,9 @@ struct domain
     atomic_t         shr_pages;         /* shared pages */
 #endif
 
+#ifdef CONFIG_MEM_PAGING
     atomic_t         paged_pages;       /* paged-out pages */
+#endif
 
     /* Scheduling. */
     void            *sched_priv;    /* scheduler-specific data */