mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Kennedy <richard@rsk.demon.co.uk>
To: Ingo Molnar <mingo@redhat.com>, Thomas Gleixner <tglx@linutronix.de>
Cc: lkml <linux-kernel@vger.kernel.org>,
	the arch/x86 maintainers <x86@kernel.org>,
	wilsons@start.ca
Subject: [PATCH] x86: reorder mm_context_t to remove x86_64 alignment padding & so shrink mm_struct
Date: Tue, 24 May 2011 14:49:59 +0100	[thread overview]
Message-ID: <1306244999.1999.5.camel@castor.rsk> (raw)

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>

---
patch against v2.6.39
compiled & tested on x86_64.

regards
Richard



diff --git a/arch/x86/include/asm/mmu.h b/arch/x86/include/asm/mmu.h
index aeff3e8..5f55e69 100644
--- a/arch/x86/include/asm/mmu.h
+++ b/arch/x86/include/asm/mmu.h
@@ -11,14 +11,14 @@
 typedef struct {
 	void *ldt;
 	int size;
-	struct mutex lock;
-	void *vdso;
 
 #ifdef CONFIG_X86_64
 	/* True if mm supports a task running in 32 bit compatibility mode. */
 	unsigned short ia32_compat;
 #endif
 
+	struct mutex lock;
+	void *vdso;
 } mm_context_t;
 
 #ifdef CONFIG_SMP



             reply	other threads:[~2011-05-24 14:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-24 13:49 Richard Kennedy [this message]
2011-05-25 21:34 ` [tip:x86/urgent] x86: Reorder mm_context_t to remove x86_64 alignment padding and thus " tip-bot for Richard Kennedy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1306244999.1999.5.camel@castor.rsk \
    --to=richard@rsk.demon.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=wilsons@start.ca \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome