linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] trace: reorder struct ring_buffer_per_cpu to remove padding on 64bit
@ 2010-03-25 11:27 Richard Kennedy
  2010-03-25 13:38 ` Steven Rostedt
  2010-07-23 12:10 ` [tip:perf/core] trace: Reorder " tip-bot for Richard Kennedy
  0 siblings, 2 replies; 4+ messages in thread
From: Richard Kennedy @ 2010-03-25 11:27 UTC (permalink / raw)
  To: Steven Rostedt, Frederic Weisbecker, Ingo Molnar; +Cc: lkml

Reorder structure to remove 8 bytes of padding on 64 bit builds.
This shrinks the size to 128 bytes so allowing allocation from a smaller
slab & needed one fewer cache lines.

Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
----
patch against 2.6.34-rc2
compiled & booted on x86_64

regards
Richard

diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 05a9f83..421db5e 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -422,6 +422,7 @@ int ring_buffer_print_page_header(struct trace_seq
*s)
  */
 struct ring_buffer_per_cpu {
 	int				cpu;
+	atomic_t			record_disabled;
 	struct ring_buffer		*buffer;
 	spinlock_t			reader_lock;	/* serialize readers */
 	arch_spinlock_t			lock;
@@ -439,7 +440,6 @@ struct ring_buffer_per_cpu {
 	unsigned long			read;
 	u64				write_stamp;
 	u64				read_stamp;
-	atomic_t			record_disabled;
 };
 
 struct ring_buffer {



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

* Re: [PATCH] trace: reorder struct ring_buffer_per_cpu to remove padding on 64bit
  2010-03-25 11:27 [PATCH] trace: reorder struct ring_buffer_per_cpu to remove padding on 64bit Richard Kennedy
@ 2010-03-25 13:38 ` Steven Rostedt
  2010-03-25 13:44   ` Richard Kennedy
  2010-07-23 12:10 ` [tip:perf/core] trace: Reorder " tip-bot for Richard Kennedy
  1 sibling, 1 reply; 4+ messages in thread
From: Steven Rostedt @ 2010-03-25 13:38 UTC (permalink / raw)
  To: Richard Kennedy
  Cc: Frederic Weisbecker, Ingo Molnar, lkml, Arnaldo Carvalho de Melo

On Thu, 2010-03-25 at 11:27 +0000, Richard Kennedy wrote:
> Reorder structure to remove 8 bytes of padding on 64 bit builds.
> This shrinks the size to 128 bytes so allowing allocation from a smaller
> slab & needed one fewer cache lines.
> 

Thanks!

Just curious, did you use Arnaldo's pahole utility to find this?

-- Steve

> Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
> ----
> patch against 2.6.34-rc2
> compiled & booted on x86_64
> 
> regards
> Richard
> 
> diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
> index 05a9f83..421db5e 100644
> --- a/kernel/trace/ring_buffer.c
> +++ b/kernel/trace/ring_buffer.c
> @@ -422,6 +422,7 @@ int ring_buffer_print_page_header(struct trace_seq
> *s)
>   */
>  struct ring_buffer_per_cpu {
>  	int				cpu;
> +	atomic_t			record_disabled;
>  	struct ring_buffer		*buffer;
>  	spinlock_t			reader_lock;	/* serialize readers */
>  	arch_spinlock_t			lock;
> @@ -439,7 +440,6 @@ struct ring_buffer_per_cpu {
>  	unsigned long			read;
>  	u64				write_stamp;
>  	u64				read_stamp;
> -	atomic_t			record_disabled;
>  };
>  
>  struct ring_buffer {
> 
> 



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

* Re: [PATCH] trace: reorder struct ring_buffer_per_cpu to remove padding on 64bit
  2010-03-25 13:38 ` Steven Rostedt
@ 2010-03-25 13:44   ` Richard Kennedy
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Kennedy @ 2010-03-25 13:44 UTC (permalink / raw)
  To: rostedt; +Cc: Frederic Weisbecker, Ingo Molnar, lkml, Arnaldo Carvalho de Melo

On Thu, 2010-03-25 at 09:38 -0400, Steven Rostedt wrote:
> On Thu, 2010-03-25 at 11:27 +0000, Richard Kennedy wrote:
> > Reorder structure to remove 8 bytes of padding on 64 bit builds.
> > This shrinks the size to 128 bytes so allowing allocation from a smaller
> > slab & needed one fewer cache lines.
> > 
> 
> Thanks!
> 
> Just curious, did you use Arnaldo's pahole utility to find this?
> 
> -- Steve
No, but something similar I guess. I wrote my own tool that parses the
debug data & filters out the interesting results ;)

Richard


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

* [tip:perf/core] trace: Reorder struct ring_buffer_per_cpu to remove padding on 64bit
  2010-03-25 11:27 [PATCH] trace: reorder struct ring_buffer_per_cpu to remove padding on 64bit Richard Kennedy
  2010-03-25 13:38 ` Steven Rostedt
@ 2010-07-23 12:10 ` tip-bot for Richard Kennedy
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Richard Kennedy @ 2010-07-23 12:10 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, rostedt, richard, tglx

Commit-ID:  985023dee6e212493831431ba2e3ce8918f001b2
Gitweb:     http://git.kernel.org/tip/985023dee6e212493831431ba2e3ce8918f001b2
Author:     Richard Kennedy <richard@rsk.demon.co.uk>
AuthorDate: Thu, 25 Mar 2010 11:27:36 +0000
Committer:  Steven Rostedt <rostedt@goodmis.org>
CommitDate: Tue, 20 Jul 2010 21:58:44 -0400

trace: Reorder struct ring_buffer_per_cpu to remove padding on 64bit

Reorder structure to remove 8 bytes of padding on 64 bit builds.
This shrinks the size to 128 bytes so allowing allocation from a smaller
slab & needed one fewer cache lines.

Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
LKML-Reference: <1269516456.2054.8.camel@localhost>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/ring_buffer.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 28d0615..3632ce8 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -443,6 +443,7 @@ int ring_buffer_print_page_header(struct trace_seq *s)
  */
 struct ring_buffer_per_cpu {
 	int				cpu;
+	atomic_t			record_disabled;
 	struct ring_buffer		*buffer;
 	spinlock_t			reader_lock;	/* serialize readers */
 	arch_spinlock_t			lock;
@@ -462,7 +463,6 @@ struct ring_buffer_per_cpu {
 	unsigned long			read;
 	u64				write_stamp;
 	u64				read_stamp;
-	atomic_t			record_disabled;
 };
 
 struct ring_buffer {

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

end of thread, other threads:[~2010-07-23 12:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-25 11:27 [PATCH] trace: reorder struct ring_buffer_per_cpu to remove padding on 64bit Richard Kennedy
2010-03-25 13:38 ` Steven Rostedt
2010-03-25 13:44   ` Richard Kennedy
2010-07-23 12:10 ` [tip:perf/core] trace: Reorder " tip-bot for Richard Kennedy

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).