Skip to contentSkip to conversation

mm: remove alignment padding from anon_vma on (some) 64 bit builds

PATCH In review Richard Kennedy 2 participants 2 messages Aug 28, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: remove alignment padding from anon_vma on (some) 64 bit builds

Reorder structure anon_vma to remove alignment padding on 64 builds when (CONFIG_KSM || CONFIG_MIGRATION).
This will shrink the size of the anon_vma structure from 40 to 32 bytes & allow more objects per slab in its kmem_cache.

Under slub the objects in the anon_vma kmem_cache will then be 40 bytes with 102 objects per slab.
(On v2.6.36 without this patch,the size is 48 bytes and 85 objects/slab.)

compiled & tested on x86_64 using SLUB

---
patch against v2.6.36-rc2
compiled & tested on x86_64 AMD X2

regards
Richard

include/linux/rmap.h +1 -1
index 31b2fd7..5c98df6 100644
@@ -25,8 +25,8 @@
  * pointing to this anon_vma once its vma list is empty.
  */
 struct anon_vma {
-	spinlock_t lock;	/* Serialize access to vma list */
 	struct anon_vma *root;	/* Root of this anon_vma tree */
+	spinlock_t lock;	/* Serialize access to vma list */
 #if defined(CONFIG_KSM) || defined(CONFIG_MIGRATION)
 
 	/*
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Richard Kennedy

Reorder structure anon_vma to remove alignment padding on 64 builds when (CONFIG_KSM || CONFIG_MIGRATION).
This will shrink the size of the anon_vma structure from 40 to 32 bytes & allow more objects per slab in its kmem_cache.

Quoted 8 lines

Under slub the objects in the anon_vma kmem_cache will then be 40 bytes with 102 objects per slab.
(On v2.6.36 without this patch,the size is 48 bytes and 85 objects/slab.)

compiled& tested on x86_64 using SLUB

Signature · 7 lines
All rights reversed

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>