From: "Jan Beulich" Subject: [PATCH] re-order struct domain fields Date: Mon, 19 Jan 2015 15:42:46 +0000 Message-ID: <54BD340602000078000568FB@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part4277A6E6.1__=" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YDETc-00080s-84 for xen-devel@lists.xenproject.org; Mon, 19 Jan 2015 15:42:52 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Ian Campbell , Keir Fraser , Ian Jackson , Tim Deegan List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part4277A6E6.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline ... to reduce padding holes. I also wonder whether having independent spin locks side by side is really a good thing cache-line-bouncing-wise. Signed-off-by: Jan Beulich --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -306,6 +306,9 @@ struct domain { domid_t domain_id; =20 + unsigned int max_vcpus; + struct vcpu **vcpu; + shared_info_t *shared_info; /* shared data area */ =20 spinlock_t domain_lock; @@ -314,13 +317,11 @@ struct domain struct page_list_head page_list; /* linked list */ struct page_list_head xenpage_list; /* linked list (size xenheap_pages= ) */ unsigned int tot_pages; /* number of pages currently = possesed */ + unsigned int xenheap_pages; /* # pages allocated from Xen heap = */ unsigned int outstanding_pages; /* pages claimed but not = possessed */ unsigned int max_pages; /* maximum value for tot_pages = */ atomic_t shr_pages; /* number of shared pages = */ atomic_t paged_pages; /* number of paged-out pages = */ - unsigned int xenheap_pages; /* # pages allocated from Xen heap = */ - - unsigned int max_vcpus; =20 /* Scheduling. */ void *sched_priv; /* scheduler-specific data */ @@ -347,15 +348,19 @@ struct domain * Interrupt to event-channel mappings and other per-guest-pirq data. * Protected by the domain's event-channel spinlock. */ - unsigned int nr_pirqs; struct radix_tree_root pirq_tree; - - /* I/O capabilities (access to IRQs and memory-mapped I/O). */ - struct rangeset *iomem_caps; - struct rangeset *irq_caps; + unsigned int nr_pirqs; =20 enum guest_type guest_type; =20 + /* Is this guest dying (i.e., a zombie)? */ + enum { DOMDYING_alive, DOMDYING_dying, DOMDYING_dead } is_dying; + + /* Domain is paused by controller software? */ + int controller_pause_count; + + int32_t time_offset_seconds; + #ifdef HAS_PASSTHROUGH /* Does this guest need iommu mappings (-1 meaning "being set up")? = */ s8 need_iommu; @@ -364,16 +369,14 @@ struct domain bool_t auto_node_affinity; /* Is this guest fully privileged (aka dom0)? */ bool_t is_privileged; - /* Which guest this guest has privileges on */ - struct domain *target; - /* Is this guest being debugged by dom0? */ - bool_t debugger_attached; - /* Is this guest dying (i.e., a zombie)? */ - enum { DOMDYING_alive, DOMDYING_dying, DOMDYING_dead } is_dying; - /* Domain is paused by controller software? */ - int controller_pause_count; /* Domain's VCPUs are pinned 1:1 to physical CPUs? */ bool_t is_pinned; + /* Non-migratable and non-restoreable? */ + bool_t disable_migrate; + /* Is this guest being debugged by dom0? */ + bool_t debugger_attached; + /* Which guest this guest has privileges on */ + struct domain *target; =20 /* Are any VCPUs polling event channels (SCHEDOP_poll)? */ #if MAX_VIRT_CPUS <=3D BITS_PER_LONG @@ -382,6 +385,10 @@ struct domain unsigned long *poll_mask; #endif =20 + /* I/O capabilities (access to IRQs and memory-mapped I/O). */ + struct rangeset *iomem_caps; + struct rangeset *irq_caps; + /* Guest has shut down (inc. reason code)? */ spinlock_t shutdown_lock; bool_t is_shutting_down; /* in process of shutting down? */ @@ -390,15 +397,12 @@ struct domain =20 /* If this is not 0, send suspend notification here instead of * raising DOM_EXC */ - int suspend_evtchn; + evtchn_port_t suspend_evtchn; =20 atomic_t pause_count; - - unsigned long vm_assist; - atomic_t refcnt; =20 - struct vcpu **vcpu; + unsigned long vm_assist; =20 /* Bitmask of CPUs which are holding onto this domain's state. */ cpumask_var_t domain_dirty_cpumask; @@ -418,7 +422,6 @@ struct domain =20 /* OProfile support. */ struct xenoprof *xenoprof; - int32_t time_offset_seconds; =20 /* Domain watchdog. */ #define NR_DOMAIN_WATCHDOG_TIMERS 2 @@ -439,9 +442,6 @@ struct domain =20 struct lock_profile_qhead profile_head; =20 - /* Non-migratable and non-restoreable? */ - bool_t disable_migrate; - /* Various mem_events */ struct mem_event_per_domain *mem_event; =20 --=__Part4277A6E6.1__= Content-Type: text/plain; name="struct-domain-reorder.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="struct-domain-reorder.patch" re-order struct domain fields=0A=0A... to reduce padding holes.=0A=0AI = also wonder whether having independent spin locks side by side is=0Areally = a good thing cache-line-bouncing-wise.=0A=0ASigned-off-by: Jan Beulich = =0A=0A--- a/xen/include/xen/sched.h=0A+++ b/xen/include/= xen/sched.h=0A@@ -306,6 +306,9 @@ struct domain=0A {=0A domid_t = domain_id;=0A =0A+ unsigned int max_vcpus;=0A+ struct vcpu = **vcpu;=0A+=0A shared_info_t *shared_info; /* shared data area = */=0A =0A spinlock_t domain_lock;=0A@@ -314,13 +317,11 @@ struct = domain=0A struct page_list_head page_list; /* linked list */=0A = struct page_list_head xenpage_list; /* linked list (size xenheap_pages) = */=0A unsigned int tot_pages; /* number of pages currently = possesed */=0A+ unsigned int xenheap_pages; /* # pages allocated = from Xen heap */=0A unsigned int outstanding_pages; /* pages = claimed but not possessed */=0A unsigned int max_pages; /* = maximum value for tot_pages */=0A atomic_t shr_pages; = /* number of shared pages */=0A atomic_t = paged_pages; /* number of paged-out pages */=0A- unsigned = int xenheap_pages; /* # pages allocated from Xen heap */=0A-=0A- = unsigned int max_vcpus;=0A =0A /* Scheduling. */=0A void = *sched_priv; /* scheduler-specific data */=0A@@ -347,15 +348,19 = @@ struct domain=0A * Interrupt to event-channel mappings and other = per-guest-pirq data.=0A * Protected by the domain's event-channel = spinlock.=0A */=0A- unsigned int nr_pirqs;=0A struct = radix_tree_root pirq_tree;=0A-=0A- /* I/O capabilities (access to IRQs = and memory-mapped I/O). */=0A- struct rangeset *iomem_caps;=0A- = struct rangeset *irq_caps;=0A+ unsigned int nr_pirqs;=0A =0A = enum guest_type guest_type;=0A =0A+ /* Is this guest dying (i.e., a = zombie)? */=0A+ enum { DOMDYING_alive, DOMDYING_dying, DOMDYING_dead } = is_dying;=0A+=0A+ /* Domain is paused by controller software? */=0A+ = int controller_pause_count;=0A+=0A+ int32_t = time_offset_seconds;=0A+=0A #ifdef HAS_PASSTHROUGH=0A /* Does this = guest need iommu mappings (-1 meaning "being set up")? */=0A s8 = need_iommu;=0A@@ -364,16 +369,14 @@ struct domain=0A bool_t = auto_node_affinity;=0A /* Is this guest fully privileged (aka = dom0)? */=0A bool_t is_privileged;=0A- /* Which guest = this guest has privileges on */=0A- struct domain *target;=0A- /* = Is this guest being debugged by dom0? */=0A- bool_t debugger_a= ttached;=0A- /* Is this guest dying (i.e., a zombie)? */=0A- enum { = DOMDYING_alive, DOMDYING_dying, DOMDYING_dead } is_dying;=0A- /* Domain = is paused by controller software? */=0A- int controller_pau= se_count;=0A /* Domain's VCPUs are pinned 1:1 to physical CPUs? */=0A = bool_t is_pinned;=0A+ /* Non-migratable and non-restoreable= ? */=0A+ bool_t disable_migrate;=0A+ /* Is this guest = being debugged by dom0? */=0A+ bool_t debugger_attached;=0A+ = /* Which guest this guest has privileges on */=0A+ struct domain = *target;=0A =0A /* Are any VCPUs polling event channels (SCHEDOP_poll)?= */=0A #if MAX_VIRT_CPUS <=3D BITS_PER_LONG=0A@@ -382,6 +385,10 @@ struct = domain=0A unsigned long *poll_mask;=0A #endif=0A =0A+ /* I/O = capabilities (access to IRQs and memory-mapped I/O). */=0A+ struct = rangeset *iomem_caps;=0A+ struct rangeset *irq_caps;=0A+=0A /* = Guest has shut down (inc. reason code)? */=0A spinlock_t = shutdown_lock;=0A bool_t is_shutting_down; /* in process of = shutting down? */=0A@@ -390,15 +397,12 @@ struct domain=0A =0A /* If = this is not 0, send suspend notification here instead of=0A * raising = DOM_EXC */=0A- int suspend_evtchn;=0A+ evtchn_port_t = suspend_evtchn;=0A =0A atomic_t pause_count;=0A-=0A- = unsigned long vm_assist;=0A-=0A atomic_t refcnt;=0A =0A- = struct vcpu **vcpu;=0A+ unsigned long vm_assist;=0A =0A /* = Bitmask of CPUs which are holding onto this domain's state. */=0A = cpumask_var_t domain_dirty_cpumask;=0A@@ -418,7 +422,6 @@ struct = domain=0A =0A /* OProfile support. */=0A struct xenoprof *xenoprof;= =0A- int32_t time_offset_seconds;=0A =0A /* Domain watchdog. */=0A = #define NR_DOMAIN_WATCHDOG_TIMERS 2=0A@@ -439,9 +442,6 @@ struct domain=0A = =0A struct lock_profile_qhead profile_head;=0A =0A- /* Non-migratabl= e and non-restoreable? */=0A- bool_t disable_migrate;=0A-=0A /* = Various mem_events */=0A struct mem_event_per_domain *mem_event;=0A =0A --=__Part4277A6E6.1__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__Part4277A6E6.1__=--