Skip to contentSkip to conversation

sched: reorder root_domain to remove 64 bit alignment padding

PATCH In review Richard Kennedy 3 participants 5 messages Jul 15, 2011 – Jul 21, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

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

kernel/sched.c +1 -1
index 9769c75..4ecf9db 100644
@@ -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;
 };
 
#1 lore raw
Quoted 3 lines · Richard Kennedy

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!

#2 lore raw
Quoted 7 lines · Peter Zijlstra
Quoted 3 lines · Richard Kennedy

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

#3 lore raw
Quoted 6 lines · Richard Kennedy
Quoted 5 lines · Peter Zijlstra
Quoted 3 lines · Richard Kennedy

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.

Quoted 8 lines
Quoted 2 lines

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.

Signature · 4 lines
  "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
#4 lore raw

[tip:sched/core] sched: Reorder root_domain to remove 64 bit alignment padding

In reply to Richard Kennedy
Commit-ID:  26a148eb9c790149750f7e77da0d96029443d400
Gitweb:     http://git.kernel.org/tip/26a148eb9c790149750f7e77da0d96029443d400
Author:     Richard Kennedy <[email protected]>
AuthorDate: Fri, 15 Jul 2011 11:41:31 +0100
Committer:  Ingo Molnar <[email protected]>
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.

---
 kernel/sched.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/sched.c +1 -1
index f107204..e3f0bac 100644
@@ -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;
 };