From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH v4 1/5] getcpu_cache system call: cache CPU number of running thread Date: Mon, 29 Feb 2016 14:08:34 +0100 Message-ID: <6606463.JuxkKBhKjS@wuerfel> References: <1456270120-7560-1-git-send-email-mathieu.desnoyers@efficios.com> <3364335.Bqf8sAzlTS@wuerfel> <1811549980.11849.1456749709589.JavaMail.zimbra@efficios.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Return-path: In-Reply-To: <1811549980.11849.1456749709589.JavaMail.zimbra-vg+e7yoeK/dWk0Htik3J/w@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Mathieu Desnoyers Cc: Peter Zijlstra , Linus Torvalds , Ben Maurer , Thomas Gleixner , Ingo Molnar , Russell King , linux-api , Andrew Morton , Michael Kerrisk , Dave Watson , rostedt , Andy Lutomirski , Will Deacon , "Paul E. McKenney" , Chris Lameter , Andi Kleen , Josh Triplett , Paul Turner , Linux Kernel Mailing List , Catalin Marinas , Andrew Hunter , "H. Peter Anvin" List-Id: linux-api@vger.kernel.org On Monday 29 February 2016 12:41:49 Mathieu Desnoyers wrote: > ----- On Feb 29, 2016, at 5:39 AM, Arnd Bergmann arnd-r2nGTMty4D4@public.gmane.org wrote: > > What's making things worse is that on some architectures, adding > > __packed will force access by bytes rather than just reading > > a 32-bit or 64-bit numbers directly, so it's slow and non-atomic. > > Agreed that many architectures issue slower instructions when reading > from packed structures, which is unwanted. > > Could we require that each field be naturally aligned and require that > they are placed so _no_ padding whatsoever should ever be added by the > compiler ? If that's possible, then we could remove the packed. Yes, I think that is a reasonable requirement. Arnd