diff options
author | Richard Kennedy <richard@rsk.demon.co.uk> | 2011-03-22 19:32:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-03-22 20:44:03 -0400 |
commit | 481b4bb5e370aa69c1dc276bd08871ec01b41d2a (patch) | |
tree | 11a276bc58c2eb9b0a00fe751c3bf81bc3240382 /include | |
parent | cb240452bfc2ae9de7c840dd0fb3f5b33ce03c31 (diff) |
mm: mm_struct: remove 16 bytes of alignment padding on 64 bit builds
Reorder mm_struct to remove 16 bytes of alignment padding on 64 bit
builds. On my config this shrinks mm_struct by enough to fit in one
fewer cache lines and allows more objects per slab in mm_struct
kmem_cache under SLUB.
slabinfo before patch :-
Sizes (bytes) Slabs
--------------------------------
Object : 848 Total : 9
SlabObj: 896 Full : 2
SlabSiz: 16384 Partial: 5
Loss : 48 CpuSlab: 2
Align : 64 Objects: 18
slabinfo after :-
Sizes (bytes) Slabs
--------------------------------
Object : 832 Total : 7
SlabObj: 832 Full : 2
SlabSiz: 16384 Partial: 3
Loss : 0 CpuSlab: 2
Align : 64 Objects: 19
Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mm_types.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 26bc4e2cd275..02aa5619709b 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -237,8 +237,9 @@ struct mm_struct { | |||
237 | atomic_t mm_users; /* How many users with user space? */ | 237 | atomic_t mm_users; /* How many users with user space? */ |
238 | atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */ | 238 | atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */ |
239 | int map_count; /* number of VMAs */ | 239 | int map_count; /* number of VMAs */ |
240 | struct rw_semaphore mmap_sem; | 240 | |
241 | spinlock_t page_table_lock; /* Protects page tables and some counters */ | 241 | spinlock_t page_table_lock; /* Protects page tables and some counters */ |
242 | struct rw_semaphore mmap_sem; | ||
242 | 243 | ||
243 | struct list_head mmlist; /* List of maybe swapped mm's. These are globally strung | 244 | struct list_head mmlist; /* List of maybe swapped mm's. These are globally strung |
244 | * together off init_mm.mmlist, and are protected | 245 | * together off init_mm.mmlist, and are protected |
@@ -281,6 +282,9 @@ struct mm_struct { | |||
281 | unsigned int token_priority; | 282 | unsigned int token_priority; |
282 | unsigned int last_interval; | 283 | unsigned int last_interval; |
283 | 284 | ||
285 | /* How many tasks sharing this mm are OOM_DISABLE */ | ||
286 | atomic_t oom_disable_count; | ||
287 | |||
284 | unsigned long flags; /* Must use atomic bitops to access the bits */ | 288 | unsigned long flags; /* Must use atomic bitops to access the bits */ |
285 | 289 | ||
286 | struct core_state *core_state; /* coredumping support */ | 290 | struct core_state *core_state; /* coredumping support */ |
@@ -313,8 +317,6 @@ struct mm_struct { | |||
313 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE | 317 | #ifdef CONFIG_TRANSPARENT_HUGEPAGE |
314 | pgtable_t pmd_huge_pte; /* protected by page_table_lock */ | 318 | pgtable_t pmd_huge_pte; /* protected by page_table_lock */ |
315 | #endif | 319 | #endif |
316 | /* How many tasks sharing this mm are OOM_DISABLE */ | ||
317 | atomic_t oom_disable_count; | ||
318 | }; | 320 | }; |
319 | 321 | ||
320 | /* Future-safe accessor for struct mm_struct's cpu_vm_mask. */ | 322 | /* Future-safe accessor for struct mm_struct's cpu_vm_mask. */ |