Skip to contentSkip to conversation

trace: reorder perf_event_context to remove alignment padding on 64 bit builds

PATCH In review Richard Kennedy 1 participant 2 messages Mar 7, 2011 – Mar 16, 2011 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 trace: reorder perf_event_context to remove alignment padding on 64 bit builds

Remove 8 bytes of alignment padding from perf_event_context on 64 bit builds which shrinks its size to 192 bytes allowing it to fit into one fewer cache lines and into a smaller slab.

---
patch against v2.6.38-rc7
compiled and tested on x86_64

regards
Richard

include/linux/perf_event.h +1 -1
index dda5b0a..59792fe 100644
@@ -846,8 +846,8 @@ enum perf_event_context_type {
  * Used as a container for task events and CPU events as well:
  */
 struct perf_event_context {
-	enum perf_event_context_type	type;
 	struct pmu			*pmu;
+	enum perf_event_context_type	type;
 	/*
 	 * Protect the states of the events in the list,
 	 * nr_active, and the list:
#1 lore raw

[tip:perf/urgent] perf: Reorder & optimize perf_event_context to remove alignment padding on 64 bit builds

Commit-ID:  ee643c4179c3a18b018de3a4c07a7bb3a75c8e4e
Gitweb:     http://git.kernel.org/tip/ee643c4179c3a18b018de3a4c07a7bb3a75c8e4e
Author:     Richard Kennedy <[email protected]>
AuthorDate: Mon, 7 Mar 2011 15:46:59 +0000
Committer:  Ingo Molnar <[email protected]>
CommitDate: Wed, 16 Mar 2011 14:04:14 +0100

perf: Reorder & optimize perf_event_context to remove alignment padding on 64 bit builds

Remove 8 bytes of alignment padding from perf_event_context on 64 bit builds which shrinks its size to 192 bytes allowing it to fit into one fewer cache lines and into a smaller slab.

LKML-Reference: <[email protected]>

---
 include/linux/perf_event.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/perf_event.h +1 -1
index 614615b..f495c01 100644
@@ -878,8 +878,8 @@ enum perf_event_context_type {
  * Used as a container for task events and CPU events as well:
  */
 struct perf_event_context {
-	enum perf_event_context_type	type;
 	struct pmu			*pmu;
+	enum perf_event_context_type	type;
 	/*
 	 * Protect the states of the events in the list,
 	 * nr_active, and the list: