Skip to contentSkip to conversation

kobject: reorder kobject to save space on 64 bit builds

PATCH In review Richard Kennedy 1 participant 2 messages Jun 2, 2008 Driver core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kobject: reorder kobject to save space on 64 bit builds

reorder kobject to save space on 64 bit builds.
shrinks from 76 to 64 bytes & moves allocated kobject to a smaller slab.

----

Running successfully on 2.6.26-rc2 on my desktop AMD64.

include/linux/kobject.h +1 -1
index 39e709f..07124fc 100644
@@ -59,12 +59,12 @@ enum kobject_action {
 
 struct kobject {
 	const char		*name;
-	struct kref		kref;
 	struct list_head	entry;
 	struct kobject		*parent;
 	struct kset		*kset;
 	struct kobj_type	*ktype;
 	struct sysfs_dirent	*sd;
+	struct kref		kref;
 	unsigned int state_initialized:1;
 	unsigned int state_in_sysfs:1;
 	unsigned int state_add_uevent_sent:1;
#1 lore raw
Quoted 3 lines · Richard Kennedy

reorder kobject to save space on 64 bit builds.
shrinks from 76 to 64 bytes & moves allocated kobject to a smaller slab.

That size change should be 72 -> 64!

Sorry
Richard