diff options
Diffstat (limited to 'mm/memory.c')
-rw-r--r-- | mm/memory.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/mm/memory.c b/mm/memory.c index 7a11ddd5060f..9abc6008544b 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -82,6 +82,16 @@ EXPORT_SYMBOL(num_physpages); | |||
82 | EXPORT_SYMBOL(high_memory); | 82 | EXPORT_SYMBOL(high_memory); |
83 | EXPORT_SYMBOL(vmalloc_earlyreserve); | 83 | EXPORT_SYMBOL(vmalloc_earlyreserve); |
84 | 84 | ||
85 | int randomize_va_space __read_mostly = 1; | ||
86 | |||
87 | static int __init disable_randmaps(char *s) | ||
88 | { | ||
89 | randomize_va_space = 0; | ||
90 | return 0; | ||
91 | } | ||
92 | __setup("norandmaps", disable_randmaps); | ||
93 | |||
94 | |||
85 | /* | 95 | /* |
86 | * If a p?d_bad entry is found while walking page tables, report | 96 | * If a p?d_bad entry is found while walking page tables, report |
87 | * the error, before resetting entry to p?d_none. Usually (but | 97 | * the error, before resetting entry to p?d_none. Usually (but |
@@ -1871,6 +1881,7 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
1871 | goto out; | 1881 | goto out; |
1872 | 1882 | ||
1873 | entry = pte_to_swp_entry(orig_pte); | 1883 | entry = pte_to_swp_entry(orig_pte); |
1884 | again: | ||
1874 | page = lookup_swap_cache(entry); | 1885 | page = lookup_swap_cache(entry); |
1875 | if (!page) { | 1886 | if (!page) { |
1876 | swapin_readahead(entry, address, vma); | 1887 | swapin_readahead(entry, address, vma); |
@@ -1894,6 +1905,12 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma, | |||
1894 | 1905 | ||
1895 | mark_page_accessed(page); | 1906 | mark_page_accessed(page); |
1896 | lock_page(page); | 1907 | lock_page(page); |
1908 | if (!PageSwapCache(page)) { | ||
1909 | /* Page migration has occured */ | ||
1910 | unlock_page(page); | ||
1911 | page_cache_release(page); | ||
1912 | goto again; | ||
1913 | } | ||
1897 | 1914 | ||
1898 | /* | 1915 | /* |
1899 | * Back out if somebody else already faulted in this pte. | 1916 | * Back out if somebody else already faulted in this pte. |