diff options
-rw-r--r-- | arch/s390/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | drivers/of/base.c | 2 | ||||
-rw-r--r-- | fs/coredump.c | 3 | ||||
-rw-r--r-- | fs/ocfs2/dir.c | 2 | ||||
-rw-r--r-- | include/asm-generic/sections.h | 3 | ||||
-rw-r--r-- | include/asm-generic/vmlinux.lds.h | 5 | ||||
-rw-r--r-- | include/linux/console.h | 6 | ||||
-rw-r--r-- | include/linux/frontswap.h | 5 | ||||
-rw-r--r-- | kernel/printk/printk.c | 13 | ||||
-rw-r--r-- | lib/stackdepot.c | 2 | ||||
-rw-r--r-- | mm/cma.c | 3 | ||||
-rw-r--r-- | mm/hugetlb.c | 66 | ||||
-rw-r--r-- | mm/kmemleak.c | 1 | ||||
-rw-r--r-- | mm/memory-failure.c | 12 | ||||
-rw-r--r-- | mm/page_alloc.c | 2 | ||||
-rw-r--r-- | mm/shmem.c | 2 | ||||
-rw-r--r-- | mm/slab_common.c | 4 | ||||
-rw-r--r-- | mm/swapfile.c | 2 | ||||
-rwxr-xr-x | scripts/bloat-o-meter | 3 |
19 files changed, 104 insertions, 34 deletions
diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S index 000e6e91f6a0..3667d20e997f 100644 --- a/arch/s390/kernel/vmlinux.lds.S +++ b/arch/s390/kernel/vmlinux.lds.S | |||
@@ -62,9 +62,11 @@ SECTIONS | |||
62 | 62 | ||
63 | . = ALIGN(PAGE_SIZE); | 63 | . = ALIGN(PAGE_SIZE); |
64 | __start_ro_after_init = .; | 64 | __start_ro_after_init = .; |
65 | __start_data_ro_after_init = .; | ||
65 | .data..ro_after_init : { | 66 | .data..ro_after_init : { |
66 | *(.data..ro_after_init) | 67 | *(.data..ro_after_init) |
67 | } | 68 | } |
69 | __end_data_ro_after_init = .; | ||
68 | EXCEPTION_TABLE(16) | 70 | EXCEPTION_TABLE(16) |
69 | . = ALIGN(PAGE_SIZE); | 71 | . = ALIGN(PAGE_SIZE); |
70 | __end_ro_after_init = .; | 72 | __end_ro_after_init = .; |
diff --git a/drivers/of/base.c b/drivers/of/base.c index d687e6de24a0..a0bccb54a9bd 100644 --- a/drivers/of/base.c +++ b/drivers/of/base.c | |||
@@ -2077,8 +2077,6 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align)) | |||
2077 | name = of_get_property(of_aliases, "stdout", NULL); | 2077 | name = of_get_property(of_aliases, "stdout", NULL); |
2078 | if (name) | 2078 | if (name) |
2079 | of_stdout = of_find_node_opts_by_path(name, &of_stdout_options); | 2079 | of_stdout = of_find_node_opts_by_path(name, &of_stdout_options); |
2080 | if (of_stdout) | ||
2081 | console_set_by_of(); | ||
2082 | } | 2080 | } |
2083 | 2081 | ||
2084 | if (!of_aliases) | 2082 | if (!of_aliases) |
diff --git a/fs/coredump.c b/fs/coredump.c index 281b768000e6..eb9c92c9b20f 100644 --- a/fs/coredump.c +++ b/fs/coredump.c | |||
@@ -1,6 +1,7 @@ | |||
1 | #include <linux/slab.h> | 1 | #include <linux/slab.h> |
2 | #include <linux/file.h> | 2 | #include <linux/file.h> |
3 | #include <linux/fdtable.h> | 3 | #include <linux/fdtable.h> |
4 | #include <linux/freezer.h> | ||
4 | #include <linux/mm.h> | 5 | #include <linux/mm.h> |
5 | #include <linux/stat.h> | 6 | #include <linux/stat.h> |
6 | #include <linux/fcntl.h> | 7 | #include <linux/fcntl.h> |
@@ -423,7 +424,9 @@ static int coredump_wait(int exit_code, struct core_state *core_state) | |||
423 | if (core_waiters > 0) { | 424 | if (core_waiters > 0) { |
424 | struct core_thread *ptr; | 425 | struct core_thread *ptr; |
425 | 426 | ||
427 | freezer_do_not_count(); | ||
426 | wait_for_completion(&core_state->startup); | 428 | wait_for_completion(&core_state->startup); |
429 | freezer_count(); | ||
427 | /* | 430 | /* |
428 | * Wait for all the threads to become inactive, so that | 431 | * Wait for all the threads to become inactive, so that |
429 | * all the thread context (extended register state, like | 432 | * all the thread context (extended register state, like |
diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index e7054e2ac922..3ecb9f337b7d 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c | |||
@@ -3699,7 +3699,7 @@ static void ocfs2_dx_dir_transfer_leaf(struct inode *dir, u32 split_hash, | |||
3699 | static int ocfs2_dx_dir_rebalance_credits(struct ocfs2_super *osb, | 3699 | static int ocfs2_dx_dir_rebalance_credits(struct ocfs2_super *osb, |
3700 | struct ocfs2_dx_root_block *dx_root) | 3700 | struct ocfs2_dx_root_block *dx_root) |
3701 | { | 3701 | { |
3702 | int credits = ocfs2_clusters_to_blocks(osb->sb, 2); | 3702 | int credits = ocfs2_clusters_to_blocks(osb->sb, 3); |
3703 | 3703 | ||
3704 | credits += ocfs2_calc_extend_credits(osb->sb, &dx_root->dr_list); | 3704 | credits += ocfs2_calc_extend_credits(osb->sb, &dx_root->dr_list); |
3705 | credits += ocfs2_quota_trans_credits(osb->sb); | 3705 | credits += ocfs2_quota_trans_credits(osb->sb); |
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h index af0254c09424..4df64a1fc09e 100644 --- a/include/asm-generic/sections.h +++ b/include/asm-generic/sections.h | |||
@@ -14,6 +14,8 @@ | |||
14 | * [_sdata, _edata]: contains .data.* sections, may also contain .rodata.* | 14 | * [_sdata, _edata]: contains .data.* sections, may also contain .rodata.* |
15 | * and/or .init.* sections. | 15 | * and/or .init.* sections. |
16 | * [__start_rodata, __end_rodata]: contains .rodata.* sections | 16 | * [__start_rodata, __end_rodata]: contains .rodata.* sections |
17 | * [__start_data_ro_after_init, __end_data_ro_after_init]: | ||
18 | * contains data.ro_after_init section | ||
17 | * [__init_begin, __init_end]: contains .init.* sections, but .init.text.* | 19 | * [__init_begin, __init_end]: contains .init.* sections, but .init.text.* |
18 | * may be out of this range on some architectures. | 20 | * may be out of this range on some architectures. |
19 | * [_sinittext, _einittext]: contains .init.text.* sections | 21 | * [_sinittext, _einittext]: contains .init.text.* sections |
@@ -31,6 +33,7 @@ extern char _data[], _sdata[], _edata[]; | |||
31 | extern char __bss_start[], __bss_stop[]; | 33 | extern char __bss_start[], __bss_stop[]; |
32 | extern char __init_begin[], __init_end[]; | 34 | extern char __init_begin[], __init_end[]; |
33 | extern char _sinittext[], _einittext[]; | 35 | extern char _sinittext[], _einittext[]; |
36 | extern char __start_data_ro_after_init[], __end_data_ro_after_init[]; | ||
34 | extern char _end[]; | 37 | extern char _end[]; |
35 | extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[]; | 38 | extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[]; |
36 | extern char __kprobes_text_start[], __kprobes_text_end[]; | 39 | extern char __kprobes_text_start[], __kprobes_text_end[]; |
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 30747960bc54..31e1d639abed 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -259,7 +259,10 @@ | |||
259 | * own by defining an empty RO_AFTER_INIT_DATA. | 259 | * own by defining an empty RO_AFTER_INIT_DATA. |
260 | */ | 260 | */ |
261 | #ifndef RO_AFTER_INIT_DATA | 261 | #ifndef RO_AFTER_INIT_DATA |
262 | #define RO_AFTER_INIT_DATA *(.data..ro_after_init) | 262 | #define RO_AFTER_INIT_DATA \ |
263 | __start_data_ro_after_init = .; \ | ||
264 | *(.data..ro_after_init) \ | ||
265 | __end_data_ro_after_init = .; | ||
263 | #endif | 266 | #endif |
264 | 267 | ||
265 | /* | 268 | /* |
diff --git a/include/linux/console.h b/include/linux/console.h index 3672809234a7..d530c4627e54 100644 --- a/include/linux/console.h +++ b/include/linux/console.h | |||
@@ -173,12 +173,6 @@ static inline void console_sysfs_notify(void) | |||
173 | #endif | 173 | #endif |
174 | extern bool console_suspend_enabled; | 174 | extern bool console_suspend_enabled; |
175 | 175 | ||
176 | #ifdef CONFIG_OF | ||
177 | extern void console_set_by_of(void); | ||
178 | #else | ||
179 | static inline void console_set_by_of(void) {} | ||
180 | #endif | ||
181 | |||
182 | /* Suspend and resume console messages over PM events */ | 176 | /* Suspend and resume console messages over PM events */ |
183 | extern void suspend_console(void); | 177 | extern void suspend_console(void); |
184 | extern void resume_console(void); | 178 | extern void resume_console(void); |
diff --git a/include/linux/frontswap.h b/include/linux/frontswap.h index c46d2aa16d81..1d18af034554 100644 --- a/include/linux/frontswap.h +++ b/include/linux/frontswap.h | |||
@@ -106,8 +106,9 @@ static inline void frontswap_invalidate_area(unsigned type) | |||
106 | 106 | ||
107 | static inline void frontswap_init(unsigned type, unsigned long *map) | 107 | static inline void frontswap_init(unsigned type, unsigned long *map) |
108 | { | 108 | { |
109 | if (frontswap_enabled()) | 109 | #ifdef CONFIG_FRONTSWAP |
110 | __frontswap_init(type, map); | 110 | __frontswap_init(type, map); |
111 | #endif | ||
111 | } | 112 | } |
112 | 113 | ||
113 | #endif /* _LINUX_FRONTSWAP_H */ | 114 | #endif /* _LINUX_FRONTSWAP_H */ |
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index de08fc90baaf..5028f4fd504a 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c | |||
@@ -253,17 +253,6 @@ static int preferred_console = -1; | |||
253 | int console_set_on_cmdline; | 253 | int console_set_on_cmdline; |
254 | EXPORT_SYMBOL(console_set_on_cmdline); | 254 | EXPORT_SYMBOL(console_set_on_cmdline); |
255 | 255 | ||
256 | #ifdef CONFIG_OF | ||
257 | static bool of_specified_console; | ||
258 | |||
259 | void console_set_by_of(void) | ||
260 | { | ||
261 | of_specified_console = true; | ||
262 | } | ||
263 | #else | ||
264 | # define of_specified_console false | ||
265 | #endif | ||
266 | |||
267 | /* Flag: console code may call schedule() */ | 256 | /* Flag: console code may call schedule() */ |
268 | static int console_may_schedule; | 257 | static int console_may_schedule; |
269 | 258 | ||
@@ -2657,7 +2646,7 @@ void register_console(struct console *newcon) | |||
2657 | * didn't select a console we take the first one | 2646 | * didn't select a console we take the first one |
2658 | * that registers here. | 2647 | * that registers here. |
2659 | */ | 2648 | */ |
2660 | if (preferred_console < 0 && !of_specified_console) { | 2649 | if (preferred_console < 0) { |
2661 | if (newcon->index < 0) | 2650 | if (newcon->index < 0) |
2662 | newcon->index = 0; | 2651 | newcon->index = 0; |
2663 | if (newcon->setup == NULL || | 2652 | if (newcon->setup == NULL || |
diff --git a/lib/stackdepot.c b/lib/stackdepot.c index 4d830e299989..f87d138e9672 100644 --- a/lib/stackdepot.c +++ b/lib/stackdepot.c | |||
@@ -192,6 +192,7 @@ void depot_fetch_stack(depot_stack_handle_t handle, struct stack_trace *trace) | |||
192 | trace->entries = stack->entries; | 192 | trace->entries = stack->entries; |
193 | trace->skip = 0; | 193 | trace->skip = 0; |
194 | } | 194 | } |
195 | EXPORT_SYMBOL_GPL(depot_fetch_stack); | ||
195 | 196 | ||
196 | /** | 197 | /** |
197 | * depot_save_stack - save stack in a stack depot. | 198 | * depot_save_stack - save stack in a stack depot. |
@@ -283,3 +284,4 @@ exit: | |||
283 | fast_exit: | 284 | fast_exit: |
284 | return retval; | 285 | return retval; |
285 | } | 286 | } |
287 | EXPORT_SYMBOL_GPL(depot_save_stack); | ||
@@ -385,6 +385,9 @@ struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align) | |||
385 | bitmap_maxno = cma_bitmap_maxno(cma); | 385 | bitmap_maxno = cma_bitmap_maxno(cma); |
386 | bitmap_count = cma_bitmap_pages_to_bits(cma, count); | 386 | bitmap_count = cma_bitmap_pages_to_bits(cma, count); |
387 | 387 | ||
388 | if (bitmap_count > bitmap_maxno) | ||
389 | return NULL; | ||
390 | |||
388 | for (;;) { | 391 | for (;;) { |
389 | mutex_lock(&cma->lock); | 392 | mutex_lock(&cma->lock); |
390 | bitmap_no = bitmap_find_next_zero_area_off(cma->bitmap, | 393 | bitmap_no = bitmap_find_next_zero_area_off(cma->bitmap, |
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index ec49d9ef1eef..418bf01a50ed 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
@@ -1826,11 +1826,17 @@ static void return_unused_surplus_pages(struct hstate *h, | |||
1826 | * is not the case is if a reserve map was changed between calls. It | 1826 | * is not the case is if a reserve map was changed between calls. It |
1827 | * is the responsibility of the caller to notice the difference and | 1827 | * is the responsibility of the caller to notice the difference and |
1828 | * take appropriate action. | 1828 | * take appropriate action. |
1829 | * | ||
1830 | * vma_add_reservation is used in error paths where a reservation must | ||
1831 | * be restored when a newly allocated huge page must be freed. It is | ||
1832 | * to be called after calling vma_needs_reservation to determine if a | ||
1833 | * reservation exists. | ||
1829 | */ | 1834 | */ |
1830 | enum vma_resv_mode { | 1835 | enum vma_resv_mode { |
1831 | VMA_NEEDS_RESV, | 1836 | VMA_NEEDS_RESV, |
1832 | VMA_COMMIT_RESV, | 1837 | VMA_COMMIT_RESV, |
1833 | VMA_END_RESV, | 1838 | VMA_END_RESV, |
1839 | VMA_ADD_RESV, | ||
1834 | }; | 1840 | }; |
1835 | static long __vma_reservation_common(struct hstate *h, | 1841 | static long __vma_reservation_common(struct hstate *h, |
1836 | struct vm_area_struct *vma, unsigned long addr, | 1842 | struct vm_area_struct *vma, unsigned long addr, |
@@ -1856,6 +1862,14 @@ static long __vma_reservation_common(struct hstate *h, | |||
1856 | region_abort(resv, idx, idx + 1); | 1862 | region_abort(resv, idx, idx + 1); |
1857 | ret = 0; | 1863 | ret = 0; |
1858 | break; | 1864 | break; |
1865 | case VMA_ADD_RESV: | ||
1866 | if (vma->vm_flags & VM_MAYSHARE) | ||
1867 | ret = region_add(resv, idx, idx + 1); | ||
1868 | else { | ||
1869 | region_abort(resv, idx, idx + 1); | ||
1870 | ret = region_del(resv, idx, idx + 1); | ||
1871 | } | ||
1872 | break; | ||
1859 | default: | 1873 | default: |
1860 | BUG(); | 1874 | BUG(); |
1861 | } | 1875 | } |
@@ -1903,6 +1917,56 @@ static void vma_end_reservation(struct hstate *h, | |||
1903 | (void)__vma_reservation_common(h, vma, addr, VMA_END_RESV); | 1917 | (void)__vma_reservation_common(h, vma, addr, VMA_END_RESV); |
1904 | } | 1918 | } |
1905 | 1919 | ||
1920 | static long vma_add_reservation(struct hstate *h, | ||
1921 | struct vm_area_struct *vma, unsigned long addr) | ||
1922 | { | ||
1923 | return __vma_reservation_common(h, vma, addr, VMA_ADD_RESV); | ||
1924 | } | ||
1925 | |||
1926 | /* | ||
1927 | * This routine is called to restore a reservation on error paths. In the | ||
1928 | * specific error paths, a huge page was allocated (via alloc_huge_page) | ||
1929 | * and is about to be freed. If a reservation for the page existed, | ||
1930 | * alloc_huge_page would have consumed the reservation and set PagePrivate | ||
1931 | * in the newly allocated page. When the page is freed via free_huge_page, | ||
1932 | * the global reservation count will be incremented if PagePrivate is set. | ||
1933 | * However, free_huge_page can not adjust the reserve map. Adjust the | ||
1934 | * reserve map here to be consistent with global reserve count adjustments | ||
1935 | * to be made by free_huge_page. | ||
1936 | */ | ||
1937 | static void restore_reserve_on_error(struct hstate *h, | ||
1938 | struct vm_area_struct *vma, unsigned long address, | ||
1939 | struct page *page) | ||
1940 | { | ||
1941 | if (unlikely(PagePrivate(page))) { | ||
1942 | long rc = vma_needs_reservation(h, vma, address); | ||
1943 | |||
1944 | if (unlikely(rc < 0)) { | ||
1945 | /* | ||
1946 | * Rare out of memory condition in reserve map | ||
1947 | * manipulation. Clear PagePrivate so that | ||
1948 | * global reserve count will not be incremented | ||
1949 | * by free_huge_page. This will make it appear | ||
1950 | * as though the reservation for this page was | ||
1951 | * consumed. This may prevent the task from | ||
1952 | * faulting in the page at a later time. This | ||
1953 | * is better than inconsistent global huge page | ||
1954 | * accounting of reserve counts. | ||
1955 | */ | ||
1956 | ClearPagePrivate(page); | ||
1957 | } else if (rc) { | ||
1958 | rc = vma_add_reservation(h, vma, address); | ||
1959 | if (unlikely(rc < 0)) | ||
1960 | /* | ||
1961 | * See above comment about rare out of | ||
1962 | * memory condition. | ||
1963 | */ | ||
1964 | ClearPagePrivate(page); | ||
1965 | } else | ||
1966 | vma_end_reservation(h, vma, address); | ||
1967 | } | ||
1968 | } | ||
1969 | |||
1906 | struct page *alloc_huge_page(struct vm_area_struct *vma, | 1970 | struct page *alloc_huge_page(struct vm_area_struct *vma, |
1907 | unsigned long addr, int avoid_reserve) | 1971 | unsigned long addr, int avoid_reserve) |
1908 | { | 1972 | { |
@@ -3498,6 +3562,7 @@ retry_avoidcopy: | |||
3498 | spin_unlock(ptl); | 3562 | spin_unlock(ptl); |
3499 | mmu_notifier_invalidate_range_end(mm, mmun_start, mmun_end); | 3563 | mmu_notifier_invalidate_range_end(mm, mmun_start, mmun_end); |
3500 | out_release_all: | 3564 | out_release_all: |
3565 | restore_reserve_on_error(h, vma, address, new_page); | ||
3501 | put_page(new_page); | 3566 | put_page(new_page); |
3502 | out_release_old: | 3567 | out_release_old: |
3503 | put_page(old_page); | 3568 | put_page(old_page); |
@@ -3680,6 +3745,7 @@ backout: | |||
3680 | spin_unlock(ptl); | 3745 | spin_unlock(ptl); |
3681 | backout_unlocked: | 3746 | backout_unlocked: |
3682 | unlock_page(page); | 3747 | unlock_page(page); |
3748 | restore_reserve_on_error(h, vma, address, page); | ||
3683 | put_page(page); | 3749 | put_page(page); |
3684 | goto out; | 3750 | goto out; |
3685 | } | 3751 | } |
diff --git a/mm/kmemleak.c b/mm/kmemleak.c index e5355a5b423f..d1380ed93fdf 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c | |||
@@ -1414,6 +1414,7 @@ static void kmemleak_scan(void) | |||
1414 | /* data/bss scanning */ | 1414 | /* data/bss scanning */ |
1415 | scan_large_block(_sdata, _edata); | 1415 | scan_large_block(_sdata, _edata); |
1416 | scan_large_block(__bss_start, __bss_stop); | 1416 | scan_large_block(__bss_start, __bss_stop); |
1417 | scan_large_block(__start_data_ro_after_init, __end_data_ro_after_init); | ||
1417 | 1418 | ||
1418 | #ifdef CONFIG_SMP | 1419 | #ifdef CONFIG_SMP |
1419 | /* per-cpu sections scanning */ | 1420 | /* per-cpu sections scanning */ |
diff --git a/mm/memory-failure.c b/mm/memory-failure.c index de88f33519c0..19e796d36a62 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c | |||
@@ -1112,10 +1112,10 @@ int memory_failure(unsigned long pfn, int trapno, int flags) | |||
1112 | } | 1112 | } |
1113 | 1113 | ||
1114 | if (!PageHuge(p) && PageTransHuge(hpage)) { | 1114 | if (!PageHuge(p) && PageTransHuge(hpage)) { |
1115 | lock_page(hpage); | 1115 | lock_page(p); |
1116 | if (!PageAnon(hpage) || unlikely(split_huge_page(hpage))) { | 1116 | if (!PageAnon(p) || unlikely(split_huge_page(p))) { |
1117 | unlock_page(hpage); | 1117 | unlock_page(p); |
1118 | if (!PageAnon(hpage)) | 1118 | if (!PageAnon(p)) |
1119 | pr_err("Memory failure: %#lx: non anonymous thp\n", | 1119 | pr_err("Memory failure: %#lx: non anonymous thp\n", |
1120 | pfn); | 1120 | pfn); |
1121 | else | 1121 | else |
@@ -1126,9 +1126,7 @@ int memory_failure(unsigned long pfn, int trapno, int flags) | |||
1126 | put_hwpoison_page(p); | 1126 | put_hwpoison_page(p); |
1127 | return -EBUSY; | 1127 | return -EBUSY; |
1128 | } | 1128 | } |
1129 | unlock_page(hpage); | 1129 | unlock_page(p); |
1130 | get_hwpoison_page(p); | ||
1131 | put_hwpoison_page(hpage); | ||
1132 | VM_BUG_ON_PAGE(!page_count(p), p); | 1130 | VM_BUG_ON_PAGE(!page_count(p), p); |
1133 | hpage = compound_head(p); | 1131 | hpage = compound_head(p); |
1134 | } | 1132 | } |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 072d791dce2d..6de9440e3ae2 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -3658,7 +3658,7 @@ retry: | |||
3658 | /* Make sure we know about allocations which stall for too long */ | 3658 | /* Make sure we know about allocations which stall for too long */ |
3659 | if (time_after(jiffies, alloc_start + stall_timeout)) { | 3659 | if (time_after(jiffies, alloc_start + stall_timeout)) { |
3660 | warn_alloc(gfp_mask, | 3660 | warn_alloc(gfp_mask, |
3661 | "page alloction stalls for %ums, order:%u\n", | 3661 | "page allocation stalls for %ums, order:%u", |
3662 | jiffies_to_msecs(jiffies-alloc_start), order); | 3662 | jiffies_to_msecs(jiffies-alloc_start), order); |
3663 | stall_timeout += 10 * HZ; | 3663 | stall_timeout += 10 * HZ; |
3664 | } | 3664 | } |
diff --git a/mm/shmem.c b/mm/shmem.c index ad7813d73ea7..166ebf5d2bce 100644 --- a/mm/shmem.c +++ b/mm/shmem.c | |||
@@ -1483,6 +1483,8 @@ static int shmem_replace_page(struct page **pagep, gfp_t gfp, | |||
1483 | copy_highpage(newpage, oldpage); | 1483 | copy_highpage(newpage, oldpage); |
1484 | flush_dcache_page(newpage); | 1484 | flush_dcache_page(newpage); |
1485 | 1485 | ||
1486 | __SetPageLocked(newpage); | ||
1487 | __SetPageSwapBacked(newpage); | ||
1486 | SetPageUptodate(newpage); | 1488 | SetPageUptodate(newpage); |
1487 | set_page_private(newpage, swap_index); | 1489 | set_page_private(newpage, swap_index); |
1488 | SetPageSwapCache(newpage); | 1490 | SetPageSwapCache(newpage); |
diff --git a/mm/slab_common.c b/mm/slab_common.c index 71f0b28a1bec..329b03843863 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c | |||
@@ -533,8 +533,8 @@ void memcg_create_kmem_cache(struct mem_cgroup *memcg, | |||
533 | 533 | ||
534 | s = create_cache(cache_name, root_cache->object_size, | 534 | s = create_cache(cache_name, root_cache->object_size, |
535 | root_cache->size, root_cache->align, | 535 | root_cache->size, root_cache->align, |
536 | root_cache->flags, root_cache->ctor, | 536 | root_cache->flags & CACHE_CREATE_MASK, |
537 | memcg, root_cache); | 537 | root_cache->ctor, memcg, root_cache); |
538 | /* | 538 | /* |
539 | * If we could not create a memcg cache, do not complain, because | 539 | * If we could not create a memcg cache, do not complain, because |
540 | * that's not critical at all as we can always proceed with the root | 540 | * that's not critical at all as we can always proceed with the root |
diff --git a/mm/swapfile.c b/mm/swapfile.c index 2210de290b54..f30438970cd1 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c | |||
@@ -2224,6 +2224,8 @@ static unsigned long read_swap_header(struct swap_info_struct *p, | |||
2224 | swab32s(&swap_header->info.version); | 2224 | swab32s(&swap_header->info.version); |
2225 | swab32s(&swap_header->info.last_page); | 2225 | swab32s(&swap_header->info.last_page); |
2226 | swab32s(&swap_header->info.nr_badpages); | 2226 | swab32s(&swap_header->info.nr_badpages); |
2227 | if (swap_header->info.nr_badpages > MAX_SWAP_BADPAGES) | ||
2228 | return 0; | ||
2227 | for (i = 0; i < swap_header->info.nr_badpages; i++) | 2229 | for (i = 0; i < swap_header->info.nr_badpages; i++) |
2228 | swab32s(&swap_header->info.badpages[i]); | 2230 | swab32s(&swap_header->info.badpages[i]); |
2229 | } | 2231 | } |
diff --git a/scripts/bloat-o-meter b/scripts/bloat-o-meter index 19f5adfd877d..d9ff038c1b28 100755 --- a/scripts/bloat-o-meter +++ b/scripts/bloat-o-meter | |||
@@ -8,6 +8,9 @@ | |||
8 | # of the GNU General Public License, incorporated herein by reference. | 8 | # of the GNU General Public License, incorporated herein by reference. |
9 | 9 | ||
10 | import sys, os, re | 10 | import sys, os, re |
11 | from signal import signal, SIGPIPE, SIG_DFL | ||
12 | |||
13 | signal(SIGPIPE, SIG_DFL) | ||
11 | 14 | ||
12 | if len(sys.argv) != 3: | 15 | if len(sys.argv) != 3: |
13 | sys.stderr.write("usage: %s file1 file2\n" % sys.argv[0]) | 16 | sys.stderr.write("usage: %s file1 file2\n" % sys.argv[0]) |