public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 0/2]: lockless get_user_pages patchset
@ 2008-03-28  2:54 Nick Piggin
  2008-03-28  2:54 ` Nick Piggin
       [not found] ` <20080328025455.GA8083-B4tOwbsTzaBolqkO4TVVkw@public.gmane.org>
  0 siblings, 2 replies; 72+ messages in thread
From: Nick Piggin @ 2008-03-28  2:54 UTC (permalink / raw)
  To: Andrew Morton
  Cc: shaggy-V7BBcbaFuwjMbYB6QlFGEg, axboe-QHcLZuEGTsvQT0dZR+AlfA,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg,
	linux-arch-u79uwXL29TY76Z2rM5mHXA,
	torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b

Hi,

This patchset It impoves our well known oltp performance thingy by 10% on DB2
on a modest 2 socket x86 system. For a sense of scale, remember numbers being
tossed around like direct-IO giving a 12% improvement; or hugepages giving a 9%
improvement... heh.

I have a powerpc patch as well, but it needs benh to find me a bit in their pte
to use.

These patches are on top of the previous 7 patches just sent.

Nick

^ permalink raw reply	[flat|nested] 72+ messages in thread
* [patch 1/2] x86: implement pte_special
@ 2008-05-21 11:59 Nick Piggin
  0 siblings, 0 replies; 72+ messages in thread
From: Nick Piggin @ 2008-05-21 11:59 UTC (permalink / raw)
  To: Andrew Morton; +Cc: shaggy, axboe, torvalds, linux-mm, linux-arch


Implement the pte_special bit for x86. This is required to support lockless
get_user_pages, because we need to know whether or not we can refcount a
particular page given only its pte (and no vma).

Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: shaggy@austin.ibm.com
Cc: axboe@oracle.com
Cc: torvalds@linux-foundation.org
Cc: linux-mm@kvack.org
Cc: linux-arch@vger.kernel.org
---
Index: linux-2.6/include/asm-x86/pgtable.h
===================================================================
--- linux-2.6.orig/include/asm-x86/pgtable.h
+++ linux-2.6/include/asm-x86/pgtable.h
@@ -17,6 +17,7 @@
 #define _PAGE_BIT_UNUSED1	9	/* available for programmer */
 #define _PAGE_BIT_UNUSED2	10
 #define _PAGE_BIT_UNUSED3	11
+#define _PAGE_BIT_SPECIAL	_PAGE_BIT_UNUSED1
 #define _PAGE_BIT_PAT_LARGE	12	/* On 2MB or 1GB pages */
 #define _PAGE_BIT_NX           63       /* No execute: only valid after cpuid check */
 
@@ -39,6 +40,8 @@
 #define _PAGE_UNUSED3	(_AC(1, L)<<_PAGE_BIT_UNUSED3)
 #define _PAGE_PAT	(_AC(1, L)<<_PAGE_BIT_PAT)
 #define _PAGE_PAT_LARGE (_AC(1, L)<<_PAGE_BIT_PAT_LARGE)
+#define _PAGE_SPECIAL	(_AC(1, L)<<_PAGE_BIT_SPECIAL)
+#define __HAVE_ARCH_PTE_SPECIAL
 
 #if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
 #define _PAGE_NX	(_AC(1, ULL) << _PAGE_BIT_NX)
@@ -198,7 +201,7 @@ static inline int pte_exec(pte_t pte)
 
 static inline int pte_special(pte_t pte)
 {
-	return 0;
+	return pte_val(pte) & _PAGE_SPECIAL;
 }
 
 static inline int pmd_large(pmd_t pte)
@@ -264,7 +267,7 @@ static inline pte_t pte_clrglobal(pte_t 
 
 static inline pte_t pte_mkspecial(pte_t pte)
 {
-	return pte;
+	return __pte(pte_val(pte) | _PAGE_SPECIAL);
 }
 
 extern pteval_t __supported_pte_mask;

^ permalink raw reply	[flat|nested] 72+ messages in thread
* [patch 1/2] x86: implement pte_special
@ 2008-05-25 14:48 Nick Piggin
  0 siblings, 0 replies; 72+ messages in thread
From: Nick Piggin @ 2008-05-25 14:48 UTC (permalink / raw)
  To: Andrew Morton; +Cc: shaggy, jens.axboe, torvalds, linux-mm, linux-arch, apw


Implement the pte_special bit for x86. This is required to support lockless
get_user_pages, because we need to know whether or not we can refcount a
particular page given only its pte (and no vma).

Signed-off-by: Nick Piggin <npiggin@suse.de>
---
Index: linux-2.6/include/asm-x86/pgtable.h
===================================================================
--- linux-2.6.orig/include/asm-x86/pgtable.h
+++ linux-2.6/include/asm-x86/pgtable.h
@@ -17,6 +17,7 @@
 #define _PAGE_BIT_UNUSED1	9	/* available for programmer */
 #define _PAGE_BIT_UNUSED2	10
 #define _PAGE_BIT_UNUSED3	11
+#define _PAGE_BIT_SPECIAL	_PAGE_BIT_UNUSED1
 #define _PAGE_BIT_PAT_LARGE	12	/* On 2MB or 1GB pages */
 #define _PAGE_BIT_NX           63       /* No execute: only valid after cpuid check */
 
@@ -39,6 +40,8 @@
 #define _PAGE_UNUSED3	(_AC(1, L)<<_PAGE_BIT_UNUSED3)
 #define _PAGE_PAT	(_AC(1, L)<<_PAGE_BIT_PAT)
 #define _PAGE_PAT_LARGE (_AC(1, L)<<_PAGE_BIT_PAT_LARGE)
+#define _PAGE_SPECIAL	(_AC(1, L)<<_PAGE_BIT_SPECIAL)
+#define __HAVE_ARCH_PTE_SPECIAL
 
 #if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE)
 #define _PAGE_NX	(_AC(1, ULL) << _PAGE_BIT_NX)
@@ -199,7 +202,7 @@ static inline int pte_exec(pte_t pte)
 
 static inline int pte_special(pte_t pte)
 {
-	return 0;
+	return pte_val(pte) & _PAGE_SPECIAL;
 }
 
 static inline int pmd_large(pmd_t pte)
@@ -265,7 +268,7 @@ static inline pte_t pte_clrglobal(pte_t 
 
 static inline pte_t pte_mkspecial(pte_t pte)
 {
-	return pte;
+	return __pte(pte_val(pte) | _PAGE_SPECIAL);
 }
 
 extern pteval_t __supported_pte_mask;

^ permalink raw reply	[flat|nested] 72+ messages in thread

end of thread, other threads:[~2008-05-25 14:48 UTC | newest]

Thread overview: 72+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-28  2:54 [patch 0/2]: lockless get_user_pages patchset Nick Piggin
2008-03-28  2:54 ` Nick Piggin
     [not found] ` <20080328025455.GA8083-B4tOwbsTzaBolqkO4TVVkw@public.gmane.org>
2008-03-28  2:55   ` [patch 1/2]: x86: implement pte_special Nick Piggin
2008-03-28  2:55     ` Nick Piggin
     [not found]     ` <20080328025541.GB8083-B4tOwbsTzaBolqkO4TVVkw@public.gmane.org>
2008-03-28  3:23       ` David Miller
2008-03-28  3:23         ` David Miller
     [not found]         ` <20080327.202334.250213398.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2008-03-28  3:31           ` Nick Piggin
2008-03-28  3:31             ` Nick Piggin
     [not found]             ` <20080328033149.GD8083-B4tOwbsTzaBolqkO4TVVkw@public.gmane.org>
2008-03-28  3:44               ` David Miller
2008-03-28  3:44                 ` David Miller
     [not found]                 ` <20080327.204431.201380891.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2008-03-28  4:04                   ` Nick Piggin
2008-03-28  4:04                     ` Nick Piggin
     [not found]                     ` <20080328040442.GE8083-B4tOwbsTzaBolqkO4TVVkw@public.gmane.org>
2008-03-28  4:09                       ` David Miller
2008-03-28  4:09                         ` David Miller
     [not found]                         ` <20080327.210910.101408473.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2008-03-28  4:15                           ` Nick Piggin
2008-03-28  4:15                             ` Nick Piggin
     [not found]                             ` <20080328041519.GF8083-B4tOwbsTzaBolqkO4TVVkw@public.gmane.org>
2008-03-28  4:16                               ` David Miller
2008-03-28  4:16                                 ` David Miller
     [not found]                                 ` <20080327.211632.02770342.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2008-03-28  4:19                                   ` Nick Piggin
2008-03-28  4:19                                     ` Nick Piggin
2008-03-28  4:17                               ` Nick Piggin
2008-03-28  4:17                                 ` Nick Piggin
2008-03-28  3:00   ` [patch 2/2]: introduce fast_gup Nick Piggin
2008-03-28  3:00     ` Nick Piggin
     [not found]     ` <20080328030023.GC8083-B4tOwbsTzaBolqkO4TVVkw@public.gmane.org>
2008-03-28 10:01       ` Jens Axboe
2008-03-28 10:01         ` Jens Axboe
2008-04-17 15:03       ` Peter Zijlstra
2008-04-17 15:03         ` Peter Zijlstra
2008-04-17 15:25         ` Linus Torvalds
2008-04-17 15:25           ` Linus Torvalds
     [not found]           ` <alpine.LFD.1.00.0804170814090.2879-5CScLwifNT1QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
2008-04-17 16:12             ` Peter Zijlstra
2008-04-17 16:12               ` Peter Zijlstra
2008-04-17 16:18               ` Linus Torvalds
2008-04-17 16:18                 ` Linus Torvalds
     [not found]                 ` <alpine.LFD.1.00.0804170916470.2879-5CScLwifNT1QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
2008-04-17 16:35                   ` Peter Zijlstra
2008-04-17 16:35                     ` Peter Zijlstra
2008-04-17 16:40                     ` Linus Torvalds
2008-04-17 16:40                       ` Linus Torvalds
     [not found]                       ` <alpine.LFD.1.00.0804170940270.2879-5CScLwifNT1QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
2008-04-17 17:23                         ` Peter Zijlstra
2008-04-17 17:23                           ` Peter Zijlstra
2008-04-17 18:28                           ` Linus Torvalds
2008-04-17 18:28                             ` Linus Torvalds
     [not found]                             ` <alpine.LFD.1.00.0804171127310.2879-5CScLwifNT1QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org>
2008-04-22  3:14                               ` Nick Piggin
2008-04-22  3:14                                 ` Nick Piggin
2008-04-18  6:31                           ` Geert Uytterhoeven
2008-04-18  6:31                             ` Geert Uytterhoeven
2008-04-18 14:40                             ` Linus Torvalds
2008-04-18 14:40                               ` Linus Torvalds
2008-04-18  9:58               ` Jeremy Fitzhardinge
2008-04-18  9:58                 ` Jeremy Fitzhardinge
2008-04-21 12:00             ` Avi Kivity
2008-04-21 12:00               ` Avi Kivity
     [not found]               ` <480C81C4.8030200-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-04-21 12:30                 ` Peter Zijlstra
2008-04-21 12:30                   ` Peter Zijlstra
2008-04-21 13:26                   ` Avi Kivity
2008-04-21 13:26                     ` Avi Kivity
     [not found]                     ` <480C9619.2050201-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-04-21 14:35                       ` Peter Zijlstra
2008-04-21 14:35                         ` Peter Zijlstra
2008-04-22  3:23                         ` Nick Piggin
2008-04-22  3:23                           ` Nick Piggin
     [not found]                           ` <20080422032319.GB21993-B4tOwbsTzaBolqkO4TVVkw@public.gmane.org>
2008-04-22  7:19                             ` Avi Kivity
2008-04-22  7:19                               ` Avi Kivity
2008-04-22  8:07                             ` Ingo Molnar
2008-04-22  8:07                               ` Ingo Molnar
2008-04-22  9:42       ` Peter Zijlstra
2008-04-22  9:42         ` Peter Zijlstra
2008-04-22  9:46         ` Nick Piggin
2008-04-22  9:46           ` Nick Piggin
2008-05-14 18:33           ` Dave Kleikamp
2008-05-15  1:13             ` Nick Piggin
  -- strict thread matches above, loose matches on Subject: below --
2008-05-21 11:59 [patch 1/2] x86: implement pte_special Nick Piggin
2008-05-25 14:48 Nick Piggin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox