From: David Vrabel Subject: [PATCHv1 6/6] evtchn: pad struct evtchn to 64 bytes Date: Tue, 9 Jun 2015 15:59:59 +0100 Message-ID: <1433861999-15771-7-git-send-email-david.vrabel@citrix.com> References: <1433861999-15771-1-git-send-email-david.vrabel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z2L1R-0005Wv-B6 for xen-devel@lists.xenproject.org; Tue, 09 Jun 2015 15:01:01 +0000 In-Reply-To: <1433861999-15771-1-git-send-email-david.vrabel@citrix.com> 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@lists.xenproject.org Cc: Keir Fraser , Tim Deegan , David Vrabel , Jan Beulich , Ian Campbell List-Id: xen-devel@lists.xenproject.org The number of struct evtchn in a page must be a power of two. Under some workloads performance is improved slightly by padding struct evtchn to 64 bytes (a cache line), thus putting the per-channel locks into their own cache line. This does not decrease the number of struct evtchn's per-page. Signed-off-by: David Vrabel --- I'm not sure we actually want to do this. I think it would be better to pack the struct evtchn and use vmap to turn the pages into a linear array for quicker lookup. --- xen/include/xen/sched.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index 292e28f..0749c43 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -110,8 +110,8 @@ struct evtchn u8 priority; u8 last_priority; u16 last_vcpu_id; -#ifdef XSM_ENABLE union { +#ifdef XSM_ENABLE #ifdef XSM_NEED_GENERIC_EVTCHN_SSID /* * If an XSM module needs more space for its event channel context, @@ -127,8 +127,9 @@ struct evtchn */ u32 flask_sid; #endif - } ssid; #endif + u8 __pad[24]; /* Round size to power of two. */ + } ssid; }; int evtchn_init(struct domain *d); /* from domain_create */ -- 1.7.10.4