[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMuHMdVFFCjoEWbWxCQ3OVCyY0-tr9NGm15UYJ9+GP_OtWcWMg@mail.gmail.com>
Date: Wed, 2 Mar 2016 11:44:46 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Cc: Arnd Bergmann <arnd@...db.de>,
Peter Zijlstra <peterz@...radead.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Ben Maurer <bmaurer@...com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
Russell King <linux@....linux.org.uk>,
linux-api <linux-api@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Michael Kerrisk <mtk.manpages@...il.com>,
Dave Watson <davejwatson@...com>,
rostedt <rostedt@...dmis.org>,
Andy Lutomirski <luto@...capital.net>,
Will Deacon <will.deacon@....com>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Chris Lameter <cl@...ux.com>, Andi Kleen <andi@...stfloor.org>,
Josh Triplett <josh@...htriplett.org>,
Paul Turner <pjt@...gle.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Catalin Marinas <catalin.marinas@....com>,
Andrew Hunter <ahh@...gle.com>,
"H. Peter Anvin" <hpa@...or.com>
Subject: Re: [PATCH v4 1/5] getcpu_cache system call: cache CPU number of
running thread
On Mon, Feb 29, 2016 at 1:41 PM, Mathieu Desnoyers
<mathieu.desnoyers@...icios.com> wrote:
> ----- On Feb 29, 2016, at 5:39 AM, Arnd Bergmann arnd@...db.de wrote:
>
>> On Monday 29 February 2016 11:32:21 Peter Zijlstra wrote:
>>> On Sun, Feb 28, 2016 at 12:39:54AM +0000, Mathieu Desnoyers wrote:
>>>
>>> > /* This structure needs to be aligned cache line size. */
>>> > struct thread_local_abi {
>>> > int32_t cpu_id;
>>> > uint32_t rseq_seqnum;
>>> > uint64_t rseq_post_commit_ip;
>>> > /* Add new fields at the end. */
>>> > } __attribute__((packed));
>>>
>>> I would really not use packed; that can lead to horrible layout.
>>>
>>> Suppose someone would add:
>>>
>>> uint32_t foo;
>>> uint64_t bar;
>>>
>>> With packed, you get an unaligned uint64_t in there, which is horrible.
>>> Without packed, you get a hole, which you can later fill.
>>
>
> Actually, Peter is wrong about the hole there. On some 32-bit architectures,
> 64-bit integers are aligned on 32-bit, not 64-bit. So there may or may not
... or even on 16-bit.
> be a hole there, and that would lead to a mess.
indeed.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists