From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756918AbcB0XyJ (ORCPT ); Sat, 27 Feb 2016 18:54:09 -0500 Received: from mail.efficios.com ([78.47.125.74]:53649 "EHLO mail.efficios.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756789AbcB0XyH (ORCPT ); Sat, 27 Feb 2016 18:54:07 -0500 Date: Sat, 27 Feb 2016 23:53:56 +0000 (UTC) From: Mathieu Desnoyers To: Linus Torvalds Cc: Peter Zijlstra , "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 Message-ID: <1401667361.10273.1456617236327.JavaMail.zimbra@efficios.com> In-Reply-To: References: <1456270120-7560-1-git-send-email-mathieu.desnoyers@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> Subject: Re: [PATCH v4 1/5] getcpu_cache system call: cache CPU number of running thread MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [78.47.125.74] X-Mailer: Zimbra 8.6.0_GA_1178 (ZimbraWebClient - FF44 (Linux)/8.6.0_GA_1178) Thread-Topic: getcpu_cache system call: cache CPU number of running thread Thread-Index: V6LW8VYJVpNX23ViZiavPNXLFzyDtA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ----- On Feb 27, 2016, at 1:35 PM, Linus Torvalds torvalds@linux-foundation.org wrote: > On Sat, Feb 27, 2016 at 6:58 AM, Peter Zijlstra wrote: >> >> Paul's patches have the following structure: >> >> struct thread_local_abi { >> union { >> struct { >> u32 cpu_id; >> u32 seq; >> }; >> u64 cpu_seq; >> }; >> unsigned long post_commit_ip; >> }; > > Please don't do "unsigned long" in ABI structures any more. > > Make it u64, and make sure it is 64-bit aligned (which it would be in > this case). Make it so that we don't have to have separate compat > paths. AFAIU, this "post_commit_ip" field is expected to be updated with a single-copy-store by user-space. If we want to handle both 32-bit and 64-bit processes, how do you recommend doing this without an unsigned long type ? A 64-bit integer would not be a single-copy store for 32-bit processes, but a 32-bit integer would not be large enough for 64-bit processes. Would a union { uint32_t val32; uint64_t val64; } field; be an acceptable option ? Then the kernel could use one field or the other depending on the process bitness. Thanks, Mathieu -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com