Skip to content

Commit af6a25f

Browse files
Richard KennedyIngo Molnar
authored andcommitted
x86: Reorder mm_context_t to remove x86_64 alignment padding and thus shrink mm_struct
Reorder mm_context_t to remove alignment padding on 64 bit builds shrinking its size from 64 to 56 bytes. This allows mm_struct to shrink from 840 to 832 bytes, so using one fewer cache lines, and getting more objects per slab when using slub. slabinfo mm_struct reports before :- Sizes (bytes) Slabs ----------------------------------- Object : 840 Total : 7 SlabObj: 896 Full : 1 SlabSiz: 16384 Partial: 4 Loss : 56 CpuSlab: 2 Align : 64 Objects: 18 after :- Sizes (bytes) Slabs ---------------------------------- Object : 832 Total : 7 SlabObj: 832 Full : 1 SlabSiz: 16384 Partial: 4 Loss : 0 CpuSlab: 2 Align : 64 Objects: 19 Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk> Cc: wilsons@start.ca Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Pekka Enberg <penberg@kernel.org> Link: http://lkml.kernel.org/r/1306244999.1999.5.camel@castor.rsk Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent f073cc8 commit af6a25f

File tree

1 file changed

+2
-2
lines changed
  • arch/x86/include/asm

1 file changed

+2
-2
lines changed

arch/x86/include/asm/mmu.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
typedef struct {
1212
void *ldt;
1313
int size;
14-
struct mutex lock;
15-
void *vdso;
1614

1715
#ifdef CONFIG_X86_64
1816
/* True if mm supports a task running in 32 bit compatibility mode. */
1917
unsigned short ia32_compat;
2018
#endif
2119

20+
struct mutex lock;
21+
void *vdso;
2222
} mm_context_t;
2323

2424
#ifdef CONFIG_SMP

0 commit comments

Comments
 (0)