Re: [PATCH v4 1/5] getcpu_cache system call: cache CPU number of running thread

From: Linus Torvalds
Date: Sun Feb 28 2016 - 11:21:16 EST


On Sun, Feb 28, 2016 at 5:07 AM, Geert Uytterhoeven
<geert@xxxxxxxxxxxxxx> 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