From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCH 2/2] events/fifo: don't corrupt queues if an old tail moves queues Date: Mon, 11 Nov 2013 17:47:55 +0000 Message-ID: <5281184B.8020708@citrix.com> References: <1384185808-13822-1-git-send-email-david.vrabel@citrix.com> <1384185808-13822-3-git-send-email-david.vrabel@citrix.com> <528117E5020000780010208F@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Vfvaj-000759-AX for xen-devel@lists.xenproject.org; Mon, 11 Nov 2013 17:48:01 +0000 In-Reply-To: <528117E5020000780010208F@nat28.tlf.novell.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: Jan Beulich Cc: xen-devel , Keir Fraser List-Id: xen-devel@lists.xenproject.org On 11/11/13 16:46, Jan Beulich wrote: >>>> On 11.11.13 at 17:03, David Vrabel wrote: >> --- a/xen/include/xen/sched.h >> +++ b/xen/include/xen/sched.h >> @@ -98,6 +98,8 @@ struct evtchn >> } u; >> u8 priority; >> u8 pending:1; >> + u16 last_vcpu_id; >> + u8 last_priority; > > So this adds up to 5 bytes now, whereas you apparently could do > with 4. On ARM this means the structure is larger than needed; on > 64-bit (ARM or x86) it means that further additions are going to > be less obvious. I'd therefore suggest ARM: 24 bytes (3 spare bytes), 128 evtchns per page. x86_64: 32 bytes (3 spare bytes), 128 evtchns per page. > } u; > u16 last_vcpu_id; > u8 priority:4; > u8 last_priority:4; > u8 pending:1; ARM: 24 bytes (4 spare bytes), 128 evtchns per page. x86_64: 32 bytes (4 spare bytes), 128 evtchns per page. As of ea963e094a (evtchn: allow many more evtchn objects to be allocated per domain) the number of evtchns per page is a power of two so there is no change to the number with either layout. I was avoiding using bitfields for things other than single bits. Is the extra spare byte preferable to the code size increase from dealing with the bitfields? On my x86_64 build text size increases by 1684425 - 1684393 = 32 bytes. David