LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [patch 0/3] Fix alignment of custom sections made from structures (v3)
@ 2011-01-21 20:36 Mathieu Desnoyers
  2011-01-21 20:36 ` [patch 1/3] introduce __u64_aligned and U64_ALIGN() for structure alignment in custom sections (v3) Mathieu Desnoyers
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Mathieu Desnoyers @ 2011-01-21 20:36 UTC (permalink / raw)
  To: LKML, David Miller, Steven Rostedt, Frederic Weisbecker,
	Ingo Molnar, Richard Mortimer, ben, sparclinux

Hello,

Here is a patchset that fixes the Ftrace-induced crash experienced on sparc64
discussed in the following thread: https://lkml.org/lkml/2011/1/16/2

The third patch changes the Tracepoints to use the more compact alignment scheme
proposed here, even though their alignment on 32-byte works fine. This third
patch is therefore not a fix per se.

The patchset is based on 2.6.37. Hopefully there are not too many things to
update for the current -git.

Changelog since v2: drop the "packed" attribute, because it caused unaligned 
acceses on sparc64 by dropping the padding between consecutive "int" and 
"pointer"/"long" fields.

Comments are welcome,

Mathieu

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com

^ permalink raw reply	[flat|nested] 16+ messages in thread
* [PATCH 0/3] [GIT PULL][v2.6.38] tracing: fix unaligned event arrays
@ 2011-01-26  4:04 Steven Rostedt
  2011-01-26  4:05 ` [PATCH 2/3] tracing: Fix sparc64 alignment crash with __u64_aligned/U64_ALIGN() Steven Rostedt
  0 siblings, 1 reply; 16+ messages in thread
From: Steven Rostedt @ 2011-01-26  4:04 UTC (permalink / raw)
  To: linux-kernel
  Cc: Ingo Molnar, Andrew Morton, Frederic Weisbecker, David Miller,
	Mathieu Desnoyers


Ingo,

It was discovered that the alignment of the trace event sections
break sparc64. The trace events are created by linker magic, so
gcc does not realize that the structures being allocated will end
up in an array. Without adding any alignment, x86_64 would create
the trace event arrays with holes that would break reading the
events in serial. The fix for that was to force a align(4) to
keep gcc and the linker from spacing the event structures at various
alignments. But recent changes have caused this change to break
sparc due to bad alignment in the structures, caused by the 4 byte
alignment.

After some discussions, Mathieu came up with the following patch set
to correctly fix the alignment issues with the trace event structures.

Please pull the latest tip/perf/urgent tree, which can be found at:

  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
tip/perf/urgent


Mathieu Desnoyers (3):
      Introduce __u64_aligned and U64_ALIGN() for structure alignment in custom sections
      tracing: Fix sparc64 alignment crash with __u64_aligned/U64_ALIGN()
      tracepoints: Use __u64_aligned/U64_ALIGN()

----
 include/asm-generic/vmlinux.lds.h |   27 +++++++++++-------
 include/linux/align-section.h     |   54 +++++++++++++++++++++++++++++++++++++
 include/linux/compiler.h          |    8 +++--
 include/linux/ftrace_event.h      |    2 +-
 include/linux/syscalls.h          |   12 ++++----
 include/linux/tracepoint.h        |   12 +++-----
 include/trace/ftrace.h            |    8 +++---
 include/trace/syscall.h           |    2 +-
 kernel/trace/trace.h              |    2 +-
 kernel/trace/trace_export.c       |    2 +-
 10 files changed, 94 insertions(+), 35 deletions(-)

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2011-01-26  7:14 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-21 20:36 [patch 0/3] Fix alignment of custom sections made from structures (v3) Mathieu Desnoyers
2011-01-21 20:36 ` [patch 1/3] introduce __u64_aligned and U64_ALIGN() for structure alignment in custom sections (v3) Mathieu Desnoyers
2011-01-22  0:05   ` David Miller
2011-01-22 17:11     ` Mathieu Desnoyers
2011-01-22 17:43       ` Steven Rostedt
2011-01-25 23:34         ` Mathieu Desnoyers
2011-01-26  0:25           ` Steven Rostedt
2011-01-26  7:12   ` [tip:perf/core] Introduce __u64_aligned and U64_ALIGN() for structure alignment in custom sections tip-bot for Mathieu Desnoyers
2011-01-21 20:36 ` [patch 2/3] tracing: fix sparc64 alignment crash with __u64_aligned/U64_ALIGN() Mathieu Desnoyers
2011-01-22  0:05   ` David Miller
2011-01-22 17:15     ` Mathieu Desnoyers
2011-01-26  7:13   ` [tip:perf/core] tracing: Fix " tip-bot for Mathieu Desnoyers
2011-01-21 20:36 ` [patch 3/3] tracepoints: use __u64_aligned/U64_ALIGN() Mathieu Desnoyers
2011-01-22  0:05   ` David Miller
2011-01-26  7:13   ` [tip:perf/core] tracepoints: Use __u64_aligned/U64_ALIGN() tip-bot for Mathieu Desnoyers
2011-01-26  4:04 [PATCH 0/3] [GIT PULL][v2.6.38] tracing: fix unaligned event arrays Steven Rostedt
2011-01-26  4:05 ` [PATCH 2/3] tracing: Fix sparc64 alignment crash with __u64_aligned/U64_ALIGN() Steven Rostedt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).