From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Subject: Re: [PATCH v4 1/5] getcpu_cache system call: cache CPU number of running thread Date: Sun, 28 Feb 2016 08:21:09 -0800 Message-ID: References: <1456270120-7560-1-git-send-email-mathieu.desnoyers@efficios.com> <967083634.8940.1456507201156.JavaMail.zimbra@efficios.com> <724964987.9217.1456518255392.JavaMail.zimbra@efficios.com> <7096DA23-3908-40DC-A46B-C4CF2252CEE8@zytor.com> <1150363257.9781.1456533630895.JavaMail.zimbra@efficios.com> <56D14132.5050100@zytor.com> <2053850250.10158.1456582501604.JavaMail.zimbra@efficios.com> <20160227145809.GD6356@twins.programming.kicks-ass.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Geert Uytterhoeven Cc: Peter Zijlstra , Mathieu Desnoyers , "H. Peter Anvin" , Thomas Gleixner , Andrew Morton , Russell King , Ingo Molnar , Linux Kernel Mailing List , linux-api , Paul Turner , Andrew Hunter , Andy Lutomirski , Andi Kleen , Dave Watson , Chris Lameter , Ben Maurer , rostedt , "Paul E. McKenney" , Josh Triplett , Catalin Marinas , Will Deacon , Michael Kerrisk List-Id: linux-api@vger.kernel.org On Sun, Feb 28, 2016 at 5:07 AM, Geert Uytterhoeven wrote: > > __alignof__(u64) is not 8 on all architectures. Indeed, which is why I said "make sure it's 64-bit aligned". We do it manually for ABI structures (although we did have some discussion about adding a alignment directive, and then having an explicitly unaligned type for legacy cases that we got wrong). In the above case it was already properly aligned, because the previous structure members added up to 64-bit boundaries. Of course, nothing then stops user space from giving us structures that are unaligned to begin with, but that's not our problem. As long as the layout is correct, we're fine, and that's all we care about. Linus