Skip to contentSkip to conversation

perf events: remove 64bit alignment padding from perf_event_context

PATCH In review Richard Kennedy 2 participants 3 messages Jun 7, 2011 – Jul 1, 2011 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf events: remove 64bit alignment padding from perf_event_context

Reorder perf_event_context to remove 8 bytes of 64 bit alignment padding shrinking its size to 192 bytes, allowing it to fit into a smaller slab and use one fewer cache lines.

---

patch against v3.0-rc2
compiled & tested on x86_64

regards
Richard

include/linux/perf_event.h +1 -1
index 3412684..9d5b3d5 100644
@@ -919,8 +919,8 @@ struct perf_event_context {
 	u64				parent_gen;
 	u64				generation;
 	int				pin_count;
-	struct rcu_head			rcu_head;
 	int				nr_cgroups; /* cgroup events present */
+	struct rcu_head			rcu_head;
 };
 
 /*
#1 lore raw
Quoted 6 lines · Richard Kennedy

Reorder perf_event_context to remove 8 bytes of 64 bit alignment padding shrinking its size to 192 bytes, allowing it to fit into a smaller slab and use one fewer cache lines.

Nice, thanks!

#2 lore raw

[tip:perf/core] perf: Remove 64-bit alignment padding from perf_event_context

In reply to Richard Kennedy
Commit-ID:  28009ce4a8130af7260a9271901b4419834ad152
Gitweb:     http://git.kernel.org/tip/28009ce4a8130af7260a9271901b4419834ad152
Author:     Richard Kennedy <[email protected]>
AuthorDate: Tue, 7 Jun 2011 16:33:38 +0100
Committer:  Ingo Molnar <[email protected]>
CommitDate: Fri, 1 Jul 2011 11:06:32 +0200

perf: Remove 64-bit alignment padding from perf_event_context

Reorder perf_event_context to remove 8 bytes of 64 bit alignment padding shrinking its size to 192 bytes, allowing it to fit into a smaller slab and use one fewer cache lines.

---
 include/linux/perf_event.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/perf_event.h +1 -1
index e76a410..2f7b5d4 100644
@@ -894,8 +894,8 @@ struct perf_event_context {
 	u64				parent_gen;
 	u64				generation;
 	int				pin_count;
-	struct rcu_head			rcu_head;
 	int				nr_cgroups; /* cgroup events present */
+	struct rcu_head			rcu_head;
 };
 
 /*