public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Andrew Morton <akpm@osdl.org>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Andi Kleen <ak@suse.de>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH 1/2] folded page table walkers
Date: Fri, 18 Feb 2005 02:36:56 +1100	[thread overview]
Message-ID: <4214BA18.50604@yahoo.com.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 698 bytes --]

(Note these are all obviously just RFCs, until after 2.6.11,
at which time I'll send them off to Andrew if they've proven
OK).

Anyway, here is the patch to fold the page table walkers
nicely for 2 and 3 level implementations... now we are getting
some good reasons why people should convert to the -nop?d.h
headers :)


We cut 35% off lmbench fork time with 2 level UP i386. This
patch gets most of the improvement.

                        plain  +ptwalk +folded +funit-at-a-time for mm/
mm/memory.o text size  10935  10679    9799    9519
lmb fork                 335    327     223     218
lmb exec                1417   1445    1228    1198
lmb shell               5483   5507    5195    5087

[-- Attachment #2: vm-folded-walkers.patch --]
[-- Type: text/plain, Size: 2888 bytes --]




---

 linux-2.6-npiggin/include/asm-generic/pgtable-nopmd.h |    9 +++++++++
 linux-2.6-npiggin/include/asm-generic/pgtable-nopud.h |    8 ++++++++
 linux-2.6-npiggin/include/asm-generic/pgtable.h       |    4 ++++
 3 files changed, 21 insertions(+)

diff -puN include/asm-generic/pgtable.h~vm-folded-walkers include/asm-generic/pgtable.h
--- linux-2.6/include/asm-generic/pgtable.h~vm-folded-walkers	2005-02-18 01:54:50.000000000 +1100
+++ linux-2.6-npiggin/include/asm-generic/pgtable.h	2005-02-18 01:54:50.000000000 +1100
@@ -175,6 +175,7 @@ static inline void ptep_mkdirty(pte_t *p
  *
  * see for_each_pgd
  */
+#ifndef for_each_pud
 #define for_each_pud(pgd, start, end, pud, pud_start, pud_end)		\
 	for (	pud = pud_offset(pgd, start),				\
 		  pud_start = start;					\
@@ -183,12 +184,14 @@ static inline void ptep_mkdirty(pte_t *p
 		  pud <= pud_offset(pgd, end-1);			\
 		pud_start = pud_end,					\
 		  pud++ )
+#endif
 
 /*
  * for_each_pmd - iterate through pmd entries in a given pud
  *
  * see for_each_pgd
  */
+#ifndef for_each_pmd
 #define for_each_pmd(pud, start, end, pmd, pmd_start, pmd_end)		\
 	for (	pmd = pmd_offset(pud, start),				\
 		  pmd_start = start;					\
@@ -197,6 +200,7 @@ static inline void ptep_mkdirty(pte_t *p
 		  pmd <= pmd_offset(pud, end-1);			\
 		pmd_start = pmd_end,					\
 		  pmd++ )
+#endif
 
 /*
  * for_each_pte_map - iterate through pte entries in a given pmd
diff -puN include/asm-generic/pgtable-nopud.h~vm-folded-walkers include/asm-generic/pgtable-nopud.h
--- linux-2.6/include/asm-generic/pgtable-nopud.h~vm-folded-walkers	2005-02-18 01:54:50.000000000 +1100
+++ linux-2.6-npiggin/include/asm-generic/pgtable-nopud.h	2005-02-18 02:22:43.000000000 +1100
@@ -52,5 +52,13 @@ static inline pud_t * pud_offset(pgd_t *
 #define pud_free(x)				do { } while (0)
 #define __pud_free_tlb(tlb, x)			do { } while (0)
 
+#undef for_each_pud
+#define for_each_pud(pgd, start, end, pud, pud_start, pud_end)	\
+	for (	pud = (pud_t *)pgd,				\
+		  pud_start = start,				\
+		  pud_end = end;				\
+		pud_start == start;				\
+		pud_start++ )
+
 #endif /* __ASSEMBLY__ */
 #endif /* _PGTABLE_NOPUD_H */
diff -puN include/asm-generic/pgtable-nopmd.h~vm-folded-walkers include/asm-generic/pgtable-nopmd.h
--- linux-2.6/include/asm-generic/pgtable-nopmd.h~vm-folded-walkers	2005-02-18 01:54:50.000000000 +1100
+++ linux-2.6-npiggin/include/asm-generic/pgtable-nopmd.h	2005-02-18 02:22:43.000000000 +1100
@@ -55,6 +55,15 @@ static inline pmd_t * pmd_offset(pud_t *
 #define pmd_free(x)				do { } while (0)
 #define __pmd_free_tlb(tlb, x)			do { } while (0)
 
+#undef for_each_pmd
+#define for_each_pmd(pud, start, end, pmd, pmd_start, pmd_end)	\
+	for (	pmd = (pmd_t *)pud,				\
+		  pmd_start = start,				\
+		  pmd_end = end;				\
+		pmd_start == start;				\
+		pmd_start++ )
+
+
 #endif /* __ASSEMBLY__ */
 
 #endif /* _PGTABLE_NOPMD_H */

_

             reply	other threads:[~2005-02-17 15:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-17 15:36 Nick Piggin [this message]
2005-02-17 15:40 ` [PATCH 2/2] trim unused functions Nick Piggin

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=4214BA18.50604@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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