Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754311AbaBRHbz (ORCPT ); Tue, 18 Feb 2014 02:31:55 -0500 Received: from merlin.infradead.org ([205.233.59.134]:36342 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751239AbaBRHbp (ORCPT ); Tue, 18 Feb 2014 02:31:45 -0500 Date: Tue, 18 Feb 2014 08:30:52 +0100 From: Peter Zijlstra To: Waiman Long Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Arnd Bergmann , linux-arch@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, Steven Rostedt , Andrew Morton , Michel Lespinasse , Andi Kleen , Rik van Riel , "Paul E. McKenney" , Linus Torvalds , Raghavendra K T , George Spelvin , Tim Chen , Daniel J Blueman , Alexander Fyodorov , Aswin Chandramouleeswaran , Scott J Norton , Thavatchai Makphaibulchoke Subject: Re: [PATCH v4 1/3] qspinlock: Introducing a 4-byte queue spinlock implementation Message-ID: <20140218073052.GV27965@twins.programming.kicks-ass.net> References: <1392669684-4807-1-git-send-email-Waiman.Long@hp.com> <1392669684-4807-2-git-send-email-Waiman.Long@hp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1392669684-4807-2-git-send-email-Waiman.Long@hp.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 17, 2014 at 03:41:22PM -0500, Waiman Long wrote: > +/* > + * The queue node structure > + * > + * This structure is essentially the same as the mcs_spinlock structure > + * in mcs_spinlock.h file. This structure is retained for future extension > + * where new fields may be added. > + */ > +struct qnode { > + u32 wait; /* Waiting flag */ > + struct qnode *next; /* Next queue node addr */ > +}; > + > +struct qnode_set { > + int node_idx; /* Current node to use */ > + struct qnode nodes[MAX_QNODES]; > +}; > + > +/* > + * Per-CPU queue node structures > + */ > +static DEFINE_PER_CPU(struct qnode_set, qnset) ____cacheline_aligned > + = { 0 }; You really didn't pay attention did you. That should be DEFINE_PER_CPU_ALIGNED() Furthermore, your structure is bigger than 1 cacheline; your struct qnode is 16 bytes, 4*16=64, and then you add that int. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/