From mboxrd@z Thu Jan 1 00:00:00 1970 From: Waiman Long Subject: Re: [PATCH v5 1/8] qspinlock: Introducing a 4-byte queue spinlock implementation Date: Thu, 27 Feb 2014 15:25:09 -0500 Message-ID: <530F9F25.7010904@hp.com> References: <1393427668-60228-1-git-send-email-Waiman.Long@hp.com> <1393427668-60228-2-git-send-email-Waiman.Long@hp.com> <20140226162243.GX6835@laptop.programming.kicks-ass.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20140226162243.GX6835@laptop.programming.kicks-ass.net> 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: Peter Zijlstra 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 02/26/2014 11:22 AM, Peter Zijlstra wrote: > 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. There is a 4-byte hole in the qnode structure for x86-64. I did try to make the additional PV fields used only 4 bytes so that there is no increase in size in the qnode structure unless we need to support 16K CPUs or more. -Longman