diff options
author | Jiri Olsa <jolsa@kernel.org> | 2015-12-21 17:25:30 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-01-06 13:06:06 +0300 |
commit | 25ec02f2c14466a4549c5dcc044b628c2cc46fde (patch) | |
tree | ae58731e004a75bbf63297eee3d4b4342337c184 /include/linux/sched.h | |
parent | 7d92de3a8285ab3dfd68aa3a99823acd5b190444 (diff) | |
download | linux-25ec02f2c14466a4549c5dcc044b628c2cc46fde.tar.xz |
x86/fpu: Properly align size in CHECK_MEMBER_AT_END_OF() macro
The CHECK_MEMBER_AT_END_OF(TYPE, MEMBER) checks whether MEMBER
is last member of TYPE by evaluating:
offsetof(TYPE::MEMBER) + sizeof(TYPE::MEMBER) == sizeof(TYPE)
and ensuring TYPE::MEMBER is the last member of the TYPE.
This condition breaks on structs that are padded to be
aligned. This patch ensures the TYPE alignment is taken
into account.
This bug was revealed after adding cacheline alignment into
struct sched_entity, which broke task_struct::thread check:
CHECK_MEMBER_AT_END_OF(struct task_struct, thread);
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Dave Hansen <dave@sr71.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1450707930-3445-1-git-send-email-jolsa@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/sched.h')
0 files changed, 0 insertions, 0 deletions