Skip to contentSkip to conversation

stop_machine: struct cpu_stopper, remove alignment padding on 64 bits

PATCH In review Richard Kennedy 3 participants 4 messages Aug 5, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 stop_machine: struct cpu_stopper, remove alignment padding on 64 bits

Reorder elements in structure cpu_stopper to remove alignment padding on 64 bit builds, this shrinks its size from 40 to 32 bytes saving 8 bytes per cpu.

---
patch against 2.6.35
compiled & tested on x86_64

regards
Richard

kernel/stop_machine.c +1 -1
index 70f8d90..4372ccb 100644
@@ -35,9 +35,9 @@ struct cpu_stop_done {
 /* the actual stopper, one per every possible cpu, enabled on online cpus */
 struct cpu_stopper {
 	spinlock_t		lock;
+	bool			enabled;	/* is this stopper enabled? */
 	struct list_head	works;		/* list of pending works */
 	struct task_struct	*thread;	/* stopper thread */
-	bool			enabled;	/* is this stopper enabled? */
 };
 
 static DEFINE_PER_CPU(struct cpu_stopper, cpu_stopper);
#1 lore raw
Quoted 5 lines · Richard Kennedy

Reorder elements in structure cpu_stopper to remove alignment padding on 64 bit builds, this shrinks its size from 40 to 32 bytes saving 8 bytes per cpu.

Looks good to me. Tejun will you take it or should I send it Ingo wards?

Quoted 18 lines

---

kernel/stop_machine.c +1 -1
index 70f8d90..4372ccb 100644
@@ -35,9 +35,9 @@ struct cpu_stop_done {
 /* the actual stopper, one per every possible cpu, enabled on online cpus */
 struct cpu_stopper {
 	spinlock_t		lock;
+	bool			enabled;	/* is this stopper enabled? */
 	struct list_head	works;		/* list of pending works */
 	struct task_struct	*thread;	/* stopper thread */
-	bool			enabled;	/* is this stopper enabled? */
 };
 
 static DEFINE_PER_CPU(struct cpu_stopper, cpu_stopper);
#2 lore raw

Hello, Peter.

Quoted 8 lines · Peter Zijlstra
Quoted 5 lines · Richard Kennedy

Reorder elements in structure cpu_stopper to remove alignment padding on 64 bit builds, this shrinks its size from 40 to 32 bytes saving 8 bytes per cpu.

Looks good to me. Tejun will you take it or should I send it Ingo wards?

I already asked whether Andrew could take it but routing through Ingo's tree would be good too. Let's wait for Andrew a bit for now.

Thank you.

Signature · 1 line
tejun