From: "Jan Beulich" Subject: Re: [PATCH 2/2] events/fifo: don't corrupt queues if an old tail moves queues Date: Tue, 12 Nov 2013 08:14:55 +0000 Message-ID: <5281F18F020000780010236E@nat28.tlf.novell.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> <5281184B.8020708@citrix.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 1Vg97m-0006lH-9U for xen-devel@lists.xenproject.org; Tue, 12 Nov 2013 08:15:02 +0000 In-Reply-To: <5281184B.8020708@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: David Vrabel Cc: xen-devel , Keir Fraser List-Id: xen-devel@lists.xenproject.org >>> On 11.11.13 at 18:47, David Vrabel wrote: > 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. Oh, right. > 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? Okay then without bitfields. Jan