Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1468036
| From | Geert Uytterhoeven <geert@linux-m68k.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH tip/core/rcu 2/2] documentation: Record reason for rcu_head two-byte alignment |
| Date | 2016-08-22 22:50 +0200 |
| Message-ID | <s94kp-2KX-5@gated-at.bofh.it> (permalink) |
| References | (3 earlier) <s91my-Qk-25@gated-at.bofh.it> <s92sj-1v9-73@gated-at.bofh.it> <s92BX-1yy-11@gated-at.bofh.it> <s92Vk-1VN-17@gated-at.bofh.it> <s93y2-2dU-47@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi Paul,
On Mon, Aug 22, 2016 at 9:54 PM, Paul E. McKenney
<paulmck@linux.vnet.ibm.com> wrote:
> On Mon, Aug 22, 2016 at 03:18:54PM -0400, Steven Rostedt wrote:
>> On Mon, 22 Aug 2016 20:56:09 +0200
>> Peter Zijlstra <peterz@infradead.org> wrote:
>>
>> > > Don't we have __alignof__(void *) to avoid #ifdef CONFIG_M68K and
>> > > other new macros ?
>
> Hmmm... Does __alignof__(void *) give two-byte alignment on m68k,
> allowing something like this? Heh!!! It is already there. ;-)
>
> struct callback_head {
> struct callback_head *next;
> void (*func)(struct callback_head *head);
> } __attribute__((aligned(sizeof(void *))));
No, it's aligning to sizeof(void *) (4 on m68k), not __alignof__(void *).
> #define rcu_head callback_head
>
> If so, that does sound quite attractive! Might need the WARN_ON()
> anyway, to flag wild pointers if nothing else.
>
> Adding Geert on CC for his thoughts.
__alignof__(void *) is indeed 2 on m68k, and h8300.
Note that it is 1 on crisv32!
It's 4 or 8 on anything else I have a cross-compiler for.
$ cat a.c
unsigned x = __alignof__(void *);
$ for i in /opt/cross/*/*/bin/*gcc; do echo +++ $i +++; $i -c -S a.c;
cat a.s; done | less
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH tip/core/rcu 0/2] Documentation updates "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-08-22 17:20 +0200
[PATCH tip/core/rcu 2/2] documentation: Record reason for rcu_head two-byte alignment "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-08-22 17:20 +0200
Re: [PATCH tip/core/rcu 2/2] documentation: Record reason for rcu_head two-byte alignment Peter Zijlstra <peterz@infradead.org> - 2016-08-22 18:30 +0200
Re: [PATCH tip/core/rcu 2/2] documentation: Record reason for rcu_head two-byte alignment "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-08-22 19:40 +0200
Re: [PATCH tip/core/rcu 2/2] documentation: Record reason for rcu_head two-byte alignment Eric Dumazet <edumazet@google.com> - 2016-08-22 20:50 +0200
Re: [PATCH tip/core/rcu 2/2] documentation: Record reason for rcu_head two-byte alignment Peter Zijlstra <peterz@infradead.org> - 2016-08-22 21:00 +0200
Re: [PATCH tip/core/rcu 2/2] documentation: Record reason for rcu_head two-byte alignment Steven Rostedt <rostedt@goodmis.org> - 2016-08-22 21:20 +0200
Re: [PATCH tip/core/rcu 2/2] documentation: Record reason for rcu_head two-byte alignment "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-08-22 22:00 +0200
Re: [PATCH tip/core/rcu 2/2] documentation: Record reason for rcu_head two-byte alignment Geert Uytterhoeven <geert@linux-m68k.org> - 2016-08-22 22:50 +0200
Re: [PATCH tip/core/rcu 2/2] documentation: Record reason for rcu_head two-byte alignment "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-08-22 23:20 +0200
Re: [PATCH tip/core/rcu 2/2] documentation: Record reason for rcu_head two-byte alignment Geert Uytterhoeven <geert@linux-m68k.org> - 2016-08-23 08:40 +0200
Re: [PATCH tip/core/rcu 2/2] documentation: Record reason for rcu_head two-byte alignment "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-08-23 15:50 +0200
Re: [PATCH tip/core/rcu 2/2] documentation: Record reason for rcu_head two-byte alignment Geert Uytterhoeven <geert@linux-m68k.org> - 2016-08-23 16:10 +0200
Re: [PATCH tip/core/rcu 2/2] documentation: Record reason for rcu_head two-byte alignment Geert Uytterhoeven <geert@linux-m68k.org> - 2016-08-23 16:40 +0200
Re: [PATCH tip/core/rcu 2/2] documentation: Record reason for rcu_head two-byte alignment "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-08-23 22:00 +0200
Re: [PATCH tip/core/rcu 2/2] documentation: Record reason for rcu_head two-byte alignment "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-08-23 20:50 +0200
Re: [PATCH tip/core/rcu 2/2] documentation: Record reason for rcu_head two-byte alignment "Kirill A. Shutemov" <kirill@shutemov.name> - 2016-08-24 20:10 +0200
[PATCH tip/core/rcu 1/2] rcutorture: Remove outdated config option description "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2016-08-22 17:20 +0200
csiph-web