From: Peter Zijlstra Subject: Re: [PATCH v5 1/8] qspinlock: Introducing a 4-byte queue spinlock implementation Date: Wed, 26 Feb 2014 17:22:43 +0100 Message-ID: <20140226162243.GX6835@laptop.programming.kicks-ass.net> References: <1393427668-60228-1-git-send-email-Waiman.Long@hp.com> <1393427668-60228-2-git-send-email-Waiman.Long@hp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1393427668-60228-2-git-send-email-Waiman.Long@hp.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Waiman Long Cc: Jeremy Fitzhardinge , Raghavendra K T , Boris Ostrovsky , virtualization@lists.linux-foundation.org, Andi Kleen , "H. Peter Anvin" , Michel Lespinasse , Alok Kataria , linux-arch@vger.kernel.org, x86@kernel.org, Ingo Molnar , Scott J Norton , xen-devel@lists.xenproject.org, "Paul E. McKenney" , Alexander Fyodorov , Rik van Riel , Arnd Bergmann , Konrad Rzeszutek Wilk , Daniel J Blueman , Oleg Nesterov , Steven Rostedt , Chris Wright , George Spelvin , Thomas Gleixner List-Id: linux-arch.vger.kernel.org On Wed, Feb 26, 2014 at 10:14:21AM -0500, Waiman Long wrote: > +struct qnode { > + u32 wait; /* Waiting flag */ > + struct qnode *next; /* Next queue node addr */ > +}; > + > +struct qnode_set { > + struct qnode nodes[MAX_QNODES]; > + int node_idx; /* Current node to use */ > +}; > + > +/* > + * Per-CPU queue node structures > + */ > +static DEFINE_PER_CPU_ALIGNED(struct qnode_set, qnset) = { {{0}}, 0 }; So I've not yet wrapped my head around any of this; and I see a later patch adds some paravirt gunk to this, but it does blow you can't keep it a single cacheline for the sane case.