Skip to contentSkip to conversation

sched: reorder lb_env struct members to reduce its size

PATCH In review Prashanth Nageshappa 1 participant 3 messages Jun 19, 2012 – Jul 24, 2012 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched: reorder lb_env struct members to reduce its size

Members of lb_env struct are not in appropriate order to reuse compiler added padding on 64bit architectures. In this patch we reorder those struct members and help reduce the size of the structure from 96 bytes to 80 bytes on 64 bit architectures.

---

kernel/sched/fair.c +2 -2
index 939fd63..96e36fb 100644
@@ -3102,18 +3102,18 @@ static unsigned long __read_mostly max_load_balance_interval = HZ/10;
 struct lb_env {
 	struct sched_domain	*sd;
 
-	int			src_cpu;
 	struct rq		*src_rq;
+	int			src_cpu;
 
 	int			dst_cpu;
 	struct rq		*dst_rq;
 
 	enum cpu_idle_type	idle;
 	long			imbalance;
-	unsigned int		flags;
 
 	struct list_head	*tasks;
 
+	unsigned int		flags;
 	unsigned int		loop;
 	unsigned int		loop_break;
 	unsigned int		loop_max;
#1 lore raw

[tip:sched/core] sched: Reorder 'struct lb_env' members to reduce its size

Commit-ID:  95f302e4d0833dd604210fbb415629ac3662cd39
Gitweb:     http://git.kernel.org/tip/95f302e4d0833dd604210fbb415629ac3662cd39
Author:     Prashanth Nageshappa <[email protected]>
AuthorDate: Tue, 19 Jun 2012 17:47:34 +0530
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 5 Jul 2012 21:09:08 +0200

sched: Reorder 'struct lb_env' members to reduce its size

Members of 'struct lb_env' are not in appropriate order to reuse compiler added padding on 64bit architectures. In this patch we reorder those struct members and help reduce the size of the structure from 96 bytes to 80 bytes on 64 bit architectures.

---
 kernel/sched/fair.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/sched/fair.c +2 -2
index 3704ad3..39b5771 100644
@@ -3088,18 +3088,18 @@ static unsigned long __read_mostly max_load_balance_interval = HZ/10;
 struct lb_env {
 	struct sched_domain	*sd;
 
-	int			src_cpu;
 	struct rq		*src_rq;
+	int			src_cpu;
 
 	int			dst_cpu;
 	struct rq		*dst_rq;
 
 	enum cpu_idle_type	idle;
 	long			imbalance;
-	unsigned int		flags;
 
 	struct list_head	*tasks;
 
+	unsigned int		flags;
 	unsigned int		loop;
 	unsigned int		loop_break;
 	unsigned int		loop_max;
#2 lore raw

[tip:sched/core] sched: Reorder 'struct lb_env' members to reduce its size

In reply to Prashanth Nageshappa
Commit-ID:  85c1e7dae165acd004429f81fe52bfbf55b57a98
Gitweb:     http://git.kernel.org/tip/85c1e7dae165acd004429f81fe52bfbf55b57a98
Author:     Prashanth Nageshappa <[email protected]>
AuthorDate: Tue, 19 Jun 2012 17:47:34 +0530
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 24 Jul 2012 13:55:20 +0200

sched: Reorder 'struct lb_env' members to reduce its size

Members of 'struct lb_env' are not in appropriate order to reuse compiler added padding on 64bit architectures. In this patch we reorder those struct members and help reduce the size of the structure from 96 bytes to 80 bytes on 64 bit architectures.

---
 kernel/sched/fair.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/sched/fair.c +1 -1
index dd00aaf..9361669 100644
@@ -3058,8 +3058,8 @@ static unsigned long __read_mostly max_load_balance_interval = HZ/10;
 struct lb_env {
 	struct sched_domain	*sd;
 
-	int			src_cpu;
 	struct rq		*src_rq;
+	int			src_cpu;
 
 	int			dst_cpu;
 	struct rq		*dst_rq;