Commit 93ff3346 authored by William Lee Irwin III's avatar William Lee Irwin III Committed by Linus Torvalds

[PATCH] x86 PAE swapspace expansion

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: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 7177784e
......@@ -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 */
......@@ -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 */
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment