From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754525AbcHSA7f (ORCPT ); Thu, 18 Aug 2016 20:59:35 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:60761 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754161AbcHSA7c (ORCPT ); Thu, 18 Aug 2016 20:59:32 -0400 Date: Thu, 18 Aug 2016 21:44:56 +0200 From: Peter Zijlstra To: Jason Low Cc: Waiman Long , Ingo Molnar , linux-kernel@vger.kernel.org, Linus Torvalds , Ding Tianhong , Davidlohr Bueso , "Paul E. McKenney" , Thomas Gleixner , Will Deacon , Tim Chen , Imre Deak , jason.low2@hp.com Subject: Re: [PATCH v5 3/3] locking/mutex: Ensure forward progress of waiter-spinner Message-ID: <20160818194456.GC10121@twins.programming.kicks-ass.net> References: <1470853530-37540-1-git-send-email-Waiman.Long@hpe.com> <1470853530-37540-4-git-send-email-Waiman.Long@hpe.com> <57AC9347.1060105@hpe.com> <20160818155829.GA10138@twins.programming.kicks-ass.net> <1471543480.4991.18.camel@j-VirtualBox> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1471543480.4991.18.camel@j-VirtualBox> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 18, 2016 at 11:04:40AM -0700, Jason Low wrote: > On Thu, 2016-08-18 at 17:58 +0200, Peter Zijlstra wrote: > > On Thu, Aug 11, 2016 at 11:01:27AM -0400, Waiman Long wrote: > > > The following is the updated patch that should fix the build error in > > > non-x86 platform. > > > > > > > This patch was whitespace challenged, but I think I munged it properly. > > > > I've also stuck something based on Jason's patch on top. Please have a > > look at: > > > > https://git.kernel.org/cgit/linux/kernel/git/peterz/queue.git/log/?h=locking/core > > Should we convert the flags back to type 'bool'? No, > We're using them as > booleans and we could also leave unneeded space available in case we > ever need to squeeze some more variable(s) in the structure. Because sizeof(bool) is undefined, that then leaves sizeof(struct mutex) and alignof(struct mutex) and its exact layout also undefined. Never use bool in aggregate types. Of course, an actual implementation needs a sizeof(bool) to translate things, but these are defined in the architecture ABI, not in the language. And having struct mutex change depending on whatever an architecture ABI chooses is very bad form.