All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched: reorder root_domain to remove 64 bit alignment padding
@ 2011-07-15 10:41 Richard Kennedy
  2011-07-15 10:44 ` Peter Zijlstra
  2011-07-21 18:30 ` [tip:sched/core] sched: Reorder " tip-bot for Richard Kennedy
  0 siblings, 2 replies; 5+ messages in thread
From: Richard Kennedy @ 2011-07-15 10:41 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Peter Zijlstra, lkml

Reorder root_domain to remove 8 bytes of alignment padding on 64 bit
builds, this shrinks the size from 1736 to 1728 bytes, therefore using
one fewer cachelines.

Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
---

patch against v3.0-rc7

compiled & booted on x86_64.

I've been running this patch for 2 days without any obvious problems,
but I don't have any specific RT test cases.

regards
Richard



diff --git a/kernel/sched.c b/kernel/sched.c
index 9769c75..4ecf9db 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -422,6 +422,7 @@ struct rt_rq {
  */
 struct root_domain {
 	atomic_t refcount;
+	atomic_t rto_count;
 	struct rcu_head rcu;
 	cpumask_var_t span;
 	cpumask_var_t online;
@@ -431,7 +432,6 @@ struct root_domain {
 	 * one runnable RT task.
 	 */
 	cpumask_var_t rto_mask;
-	atomic_t rto_count;
 	struct cpupri cpupri;
 };
 



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

* Re: [PATCH] sched: reorder root_domain to remove 64 bit alignment padding
  2011-07-15 10:41 [PATCH] sched: reorder root_domain to remove 64 bit alignment padding Richard Kennedy
@ 2011-07-15 10:44 ` Peter Zijlstra
  2011-07-15 11:23   ` Richard Kennedy
  2011-07-21 18:30 ` [tip:sched/core] sched: Reorder " tip-bot for Richard Kennedy
  1 sibling, 1 reply; 5+ messages in thread
From: Peter Zijlstra @ 2011-07-15 10:44 UTC (permalink / raw)
  To: Richard Kennedy; +Cc: Ingo Molnar, lkml

On Fri, 2011-07-15 at 11:41 +0100, Richard Kennedy wrote:
> Reorder root_domain to remove 8 bytes of alignment padding on 64 bit
> builds, this shrinks the size from 1736 to 1728 bytes, therefore using
> one fewer cachelines.

depends a bit on how insane struct cpupri is, but yeah, good compaction.
Thanks!

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

* Re: [PATCH] sched: reorder root_domain to remove 64 bit alignment padding
  2011-07-15 10:44 ` Peter Zijlstra
@ 2011-07-15 11:23   ` Richard Kennedy
  2011-07-15 18:59     ` Henrique de Moraes Holschuh
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Kennedy @ 2011-07-15 11:23 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: Ingo Molnar, lkml

On Fri, 2011-07-15 at 12:44 +0200, Peter Zijlstra wrote:
> On Fri, 2011-07-15 at 11:41 +0100, Richard Kennedy wrote:
> > Reorder root_domain to remove 8 bytes of alignment padding on 64 bit
> > builds, this shrinks the size from 1736 to 1728 bytes, therefore using
> > one fewer cachelines.
> 
> depends a bit on how insane struct cpupri is, but yeah, good compaction.
> Thanks!

Thanks Peter,

argh -- I hadn't spotted that cpupri used NR_CPUS and was so variable in
size. I guess there won't be much benefit then, as the distros seem to
always set NR_CPUS to some insanely huge value ;)

regards
Richard 



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

* Re: [PATCH] sched: reorder root_domain to remove 64 bit alignment padding
  2011-07-15 11:23   ` Richard Kennedy
@ 2011-07-15 18:59     ` Henrique de Moraes Holschuh
  0 siblings, 0 replies; 5+ messages in thread
From: Henrique de Moraes Holschuh @ 2011-07-15 18:59 UTC (permalink / raw)
  To: Richard Kennedy; +Cc: Peter Zijlstra, Ingo Molnar, lkml

On Fri, 15 Jul 2011, Richard Kennedy wrote:
> On Fri, 2011-07-15 at 12:44 +0200, Peter Zijlstra wrote:
> > On Fri, 2011-07-15 at 11:41 +0100, Richard Kennedy wrote:
> > > Reorder root_domain to remove 8 bytes of alignment padding on 64 bit
> > > builds, this shrinks the size from 1736 to 1728 bytes, therefore using
> > > one fewer cachelines.
> > 
> > depends a bit on how insane struct cpupri is, but yeah, good compaction.
> > Thanks!
> 
> Thanks Peter,
> 
> argh -- I hadn't spotted that cpupri used NR_CPUS and was so variable in
> size. I guess there won't be much benefit then, as the distros seem to
> always set NR_CPUS to some insanely huge value ;)

There will be, for those who _do_ care about performance (and thus have sane
NR_CPUS for their boxes, among other things).  Please don't be discouraged
over this.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

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

* [tip:sched/core] sched: Reorder root_domain to remove 64 bit alignment padding
  2011-07-15 10:41 [PATCH] sched: reorder root_domain to remove 64 bit alignment padding Richard Kennedy
  2011-07-15 10:44 ` Peter Zijlstra
@ 2011-07-21 18:30 ` tip-bot for Richard Kennedy
  1 sibling, 0 replies; 5+ messages in thread
From: tip-bot for Richard Kennedy @ 2011-07-21 18:30 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, mingo, a.p.zijlstra, richard, tglx, mingo

Commit-ID:  26a148eb9c790149750f7e77da0d96029443d400
Gitweb:     http://git.kernel.org/tip/26a148eb9c790149750f7e77da0d96029443d400
Author:     Richard Kennedy <richard@rsk.demon.co.uk>
AuthorDate: Fri, 15 Jul 2011 11:41:31 +0100
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Thu, 21 Jul 2011 18:01:52 +0200

sched: Reorder root_domain to remove 64 bit alignment padding

Reorder root_domain to remove 8 bytes of alignment padding on 64 bit
builds, this shrinks the size from 1736 to 1728 bytes, therefore using
one fewer cachelines.

Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1310726492.1977.5.camel@castor.rsk
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 kernel/sched.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index f107204..e3f0bac 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -422,6 +422,7 @@ struct rt_rq {
  */
 struct root_domain {
 	atomic_t refcount;
+	atomic_t rto_count;
 	struct rcu_head rcu;
 	cpumask_var_t span;
 	cpumask_var_t online;
@@ -431,7 +432,6 @@ struct root_domain {
 	 * one runnable RT task.
 	 */
 	cpumask_var_t rto_mask;
-	atomic_t rto_count;
 	struct cpupri cpupri;
 };
 

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

end of thread, other threads:[~2011-07-21 18:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-15 10:41 [PATCH] sched: reorder root_domain to remove 64 bit alignment padding Richard Kennedy
2011-07-15 10:44 ` Peter Zijlstra
2011-07-15 11:23   ` Richard Kennedy
2011-07-15 18:59     ` Henrique de Moraes Holschuh
2011-07-21 18:30 ` [tip:sched/core] sched: Reorder " tip-bot for Richard Kennedy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.