]> git.hungrycats.org Git - linux/commitdiff
[PATCH] x86 PAE swapspace expansion
authorWilliam Lee Irwin III <wli@holomorphy.com>
Tue, 24 Aug 2004 04:28:07 +0000 (21:28 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 24 Aug 2004 04:28:07 +0000 (21:28 -0700)
PAE is artificially limited in terms of swapspace to the same bitsplit as
ordinary i386, a 5/24 split (32 swapfiles, 64GB max swapfile size), when a
5/27 split (32 swapfiles, 512GB max swapfile size) is feasible.  This patch
transparently removes that limitation by using more of the space available
in PAE's wider ptes for swap ptes.

While this is obviously not likely to be used directly, it is important
from the standpoint of strict non-overcommit, where the swapspace must be
potentially usable in order to be reserved for non-overcommit.  There are
workloads with Committed_AS of over 256GB on ia32 PAE wanting strict
non-overcommit to prevent being OOM killed.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/asm-i386/pgtable-2level.h
include/asm-i386/pgtable-3level.h
include/asm-i386/pgtable.h

index de51110560b9d7ae83e7f0120f39b195d0a49980..58867b62f47b4e79d42925e4da7d47775d1a397a 100644 (file)
@@ -75,4 +75,11 @@ static inline int pte_exec_kernel(pte_t pte)
 #define pgoff_to_pte(off) \
        ((pte_t) { (((off) & 0x1f) << 1) + (((off) >> 5) << 8) + _PAGE_FILE })
 
+/* Encode and de-code a swap entry */
+#define __swp_type(x)                  (((x).val >> 1) & 0x1f)
+#define __swp_offset(x)                        ((x).val >> 8)
+#define __swp_entry(type, offset)      ((swp_entry_t) { ((type) << 1) | ((offset) << 8) })
+#define __pte_to_swp_entry(pte)                ((swp_entry_t) { (pte).pte_low })
+#define __swp_entry_to_pte(x)          ((pte_t) { (x).val })
+
 #endif /* _I386_PGTABLE_2LEVEL_H */
index d78e3493da720ab1c70b491670126f495045cea4..e48ab3d07c834f58bc48baa813d3c9258cf44180 100644 (file)
@@ -134,4 +134,11 @@ static inline pmd_t pfn_pmd(unsigned long page_nr, pgprot_t pgprot)
 #define pgoff_to_pte(off) ((pte_t) { _PAGE_FILE, (off) })
 #define PTE_FILE_MAX_BITS       32
 
+/* Encode and de-code a swap entry */
+#define __swp_type(x)                  (((x).val) & 0x1f)
+#define __swp_offset(x)                        ((x).val >> 5)
+#define __swp_entry(type, offset)      ((swp_entry_t){(type) | (offset) << 5})
+#define __pte_to_swp_entry(pte)                ((swp_entry_t){ (pte).pte_high })
+#define __swp_entry_to_pte(x)          ((pte_t){ 0, (x).val })
+
 #endif /* _I386_PGTABLE_3LEVEL_H */
index 8f9fcab61f5cc0fb5dd5ab106a4515eaf9bc7caf..b4ba1fd6f99dca4f63987f58fde1cc011c4841c5 100644 (file)
@@ -398,13 +398,6 @@ extern pte_t *lookup_address(unsigned long address);
                }                                                         \
        } while (0)
 
-/* Encode and de-code a swap entry */
-#define __swp_type(x)                  (((x).val >> 1) & 0x1f)
-#define __swp_offset(x)                        ((x).val >> 8)
-#define __swp_entry(type, offset)      ((swp_entry_t) { ((type) << 1) | ((offset) << 8) })
-#define __pte_to_swp_entry(pte)                ((swp_entry_t) { (pte).pte_low })
-#define __swp_entry_to_pte(x)          ((pte_t) { (x).val })
-
 #endif /* !__ASSEMBLY__ */
 
 #ifndef CONFIG_DISCONTIGMEM