Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'akpm' (patches from Andrew)

Merge misc fixes from Andrew Morton:
"15 fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
lib/stackdepot: export save/fetch stack for drivers
mm: kmemleak: scan .data.ro_after_init
memcg: prevent memcg caches to be both OFF_SLAB & OBJFREELIST_SLAB
coredump: fix unfreezable coredumping task
mm/filemap: don't allow partially uptodate page for pipes
mm/hugetlb: fix huge page reservation leak in private mapping error paths
ocfs2: fix not enough credit panic
Revert "console: don't prefer first registered if DT specifies stdout-path"
mm: hwpoison: fix thp split handling in memory_failure()
swapfile: fix memory corruption via malformed swapfile
mm/cma.c: check the max limit for cma allocation
scripts/bloat-o-meter: fix SIGPIPE
shmem: fix pageflags after swapping DMA32 object
mm, frontswap: make sure allocated frontswap map is assigned
mm: remove extra newline from allocation stall warning

+104 -34
+2
arch/s390/kernel/vmlinux.lds.S
··· 62 62 63 63 . = ALIGN(PAGE_SIZE); 64 64 __start_ro_after_init = .; 65 + __start_data_ro_after_init = .; 65 66 .data..ro_after_init : { 66 67 *(.data..ro_after_init) 67 68 } 69 + __end_data_ro_after_init = .; 68 70 EXCEPTION_TABLE(16) 69 71 . = ALIGN(PAGE_SIZE); 70 72 __end_ro_after_init = .;
-2
drivers/of/base.c
··· 2077 2077 name = of_get_property(of_aliases, "stdout", NULL); 2078 2078 if (name) 2079 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 2082 if (!of_aliases)
+3
fs/coredump.c
··· 1 1 #include <linux/slab.h> 2 2 #include <linux/file.h> 3 3 #include <linux/fdtable.h> 4 + #include <linux/freezer.h> 4 5 #include <linux/mm.h> 5 6 #include <linux/stat.h> 6 7 #include <linux/fcntl.h> ··· 424 423 if (core_waiters > 0) { 425 424 struct core_thread *ptr; 426 425 426 + freezer_do_not_count(); 427 427 wait_for_completion(&core_state->startup); 428 + freezer_count(); 428 429 /* 429 430 * Wait for all the threads to become inactive, so that 430 431 * all the thread context (extended register state, like
+1 -1
fs/ocfs2/dir.c
··· 3699 3699 static int ocfs2_dx_dir_rebalance_credits(struct ocfs2_super *osb, 3700 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 3704 credits += ocfs2_calc_extend_credits(osb->sb, &dx_root->dr_list); 3705 3705 credits += ocfs2_quota_trans_credits(osb->sb);
+3
include/asm-generic/sections.h
··· 14 14 * [_sdata, _edata]: contains .data.* sections, may also contain .rodata.* 15 15 * and/or .init.* sections. 16 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 19 * [__init_begin, __init_end]: contains .init.* sections, but .init.text.* 18 20 * may be out of this range on some architectures. 19 21 * [_sinittext, _einittext]: contains .init.text.* sections ··· 33 31 extern char __bss_start[], __bss_stop[]; 34 32 extern char __init_begin[], __init_end[]; 35 33 extern char _sinittext[], _einittext[]; 34 + extern char __start_data_ro_after_init[], __end_data_ro_after_init[]; 36 35 extern char _end[]; 37 36 extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[]; 38 37 extern char __kprobes_text_start[], __kprobes_text_end[];
+4 -1
include/asm-generic/vmlinux.lds.h
··· 259 259 * own by defining an empty RO_AFTER_INIT_DATA. 260 260 */ 261 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 266 #endif 264 267 265 268 /*
-6
include/linux/console.h
··· 173 173 #endif 174 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 176 /* Suspend and resume console messages over PM events */ 183 177 extern void suspend_console(void); 184 178 extern void resume_console(void);
+3 -2
include/linux/frontswap.h
··· 106 106 107 107 static inline void frontswap_init(unsigned type, unsigned long *map) 108 108 { 109 - if (frontswap_enabled()) 110 - __frontswap_init(type, map); 109 + #ifdef CONFIG_FRONTSWAP 110 + __frontswap_init(type, map); 111 + #endif 111 112 } 112 113 113 114 #endif /* _LINUX_FRONTSWAP_H */
+1 -12
kernel/printk/printk.c
··· 253 253 int console_set_on_cmdline; 254 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 256 /* Flag: console code may call schedule() */ 268 257 static int console_may_schedule; 269 258 ··· 2646 2657 * didn't select a console we take the first one 2647 2658 * that registers here. 2648 2659 */ 2649 - if (preferred_console < 0 && !of_specified_console) { 2660 + if (preferred_console < 0) { 2650 2661 if (newcon->index < 0) 2651 2662 newcon->index = 0; 2652 2663 if (newcon->setup == NULL ||
+2
lib/stackdepot.c
··· 192 192 trace->entries = stack->entries; 193 193 trace->skip = 0; 194 194 } 195 + EXPORT_SYMBOL_GPL(depot_fetch_stack); 195 196 196 197 /** 197 198 * depot_save_stack - save stack in a stack depot. ··· 284 283 fast_exit: 285 284 return retval; 286 285 } 286 + EXPORT_SYMBOL_GPL(depot_save_stack);
+3
mm/cma.c
··· 385 385 bitmap_maxno = cma_bitmap_maxno(cma); 386 386 bitmap_count = cma_bitmap_pages_to_bits(cma, count); 387 387 388 + if (bitmap_count > bitmap_maxno) 389 + return NULL; 390 + 388 391 for (;;) { 389 392 mutex_lock(&cma->lock); 390 393 bitmap_no = bitmap_find_next_zero_area_off(cma->bitmap,
+66
mm/hugetlb.c
··· 1826 1826 * is not the case is if a reserve map was changed between calls. It 1827 1827 * is the responsibility of the caller to notice the difference and 1828 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 1835 enum vma_resv_mode { 1831 1836 VMA_NEEDS_RESV, 1832 1837 VMA_COMMIT_RESV, 1833 1838 VMA_END_RESV, 1839 + VMA_ADD_RESV, 1834 1840 }; 1835 1841 static long __vma_reservation_common(struct hstate *h, 1836 1842 struct vm_area_struct *vma, unsigned long addr, ··· 1861 1855 case VMA_END_RESV: 1862 1856 region_abort(resv, idx, idx + 1); 1863 1857 ret = 0; 1858 + break; 1859 + case VMA_ADD_RESV: 1860 + if (vma->vm_flags & VM_MAYSHARE) 1861 + ret = region_add(resv, idx, idx + 1); 1862 + else { 1863 + region_abort(resv, idx, idx + 1); 1864 + ret = region_del(resv, idx, idx + 1); 1865 + } 1864 1866 break; 1865 1867 default: 1866 1868 BUG(); ··· 1915 1901 struct vm_area_struct *vma, unsigned long addr) 1916 1902 { 1917 1903 (void)__vma_reservation_common(h, vma, addr, VMA_END_RESV); 1904 + } 1905 + 1906 + static long vma_add_reservation(struct hstate *h, 1907 + struct vm_area_struct *vma, unsigned long addr) 1908 + { 1909 + return __vma_reservation_common(h, vma, addr, VMA_ADD_RESV); 1910 + } 1911 + 1912 + /* 1913 + * This routine is called to restore a reservation on error paths. In the 1914 + * specific error paths, a huge page was allocated (via alloc_huge_page) 1915 + * and is about to be freed. If a reservation for the page existed, 1916 + * alloc_huge_page would have consumed the reservation and set PagePrivate 1917 + * in the newly allocated page. When the page is freed via free_huge_page, 1918 + * the global reservation count will be incremented if PagePrivate is set. 1919 + * However, free_huge_page can not adjust the reserve map. Adjust the 1920 + * reserve map here to be consistent with global reserve count adjustments 1921 + * to be made by free_huge_page. 1922 + */ 1923 + static void restore_reserve_on_error(struct hstate *h, 1924 + struct vm_area_struct *vma, unsigned long address, 1925 + struct page *page) 1926 + { 1927 + if (unlikely(PagePrivate(page))) { 1928 + long rc = vma_needs_reservation(h, vma, address); 1929 + 1930 + if (unlikely(rc < 0)) { 1931 + /* 1932 + * Rare out of memory condition in reserve map 1933 + * manipulation. Clear PagePrivate so that 1934 + * global reserve count will not be incremented 1935 + * by free_huge_page. This will make it appear 1936 + * as though the reservation for this page was 1937 + * consumed. This may prevent the task from 1938 + * faulting in the page at a later time. This 1939 + * is better than inconsistent global huge page 1940 + * accounting of reserve counts. 1941 + */ 1942 + ClearPagePrivate(page); 1943 + } else if (rc) { 1944 + rc = vma_add_reservation(h, vma, address); 1945 + if (unlikely(rc < 0)) 1946 + /* 1947 + * See above comment about rare out of 1948 + * memory condition. 1949 + */ 1950 + ClearPagePrivate(page); 1951 + } else 1952 + vma_end_reservation(h, vma, address); 1953 + } 1918 1954 } 1919 1955 1920 1956 struct page *alloc_huge_page(struct vm_area_struct *vma, ··· 3562 3498 spin_unlock(ptl); 3563 3499 mmu_notifier_invalidate_range_end(mm, mmun_start, mmun_end); 3564 3500 out_release_all: 3501 + restore_reserve_on_error(h, vma, address, new_page); 3565 3502 put_page(new_page); 3566 3503 out_release_old: 3567 3504 put_page(old_page); ··· 3745 3680 spin_unlock(ptl); 3746 3681 backout_unlocked: 3747 3682 unlock_page(page); 3683 + restore_reserve_on_error(h, vma, address, page); 3748 3684 put_page(page); 3749 3685 goto out; 3750 3686 }
+1
mm/kmemleak.c
··· 1414 1414 /* data/bss scanning */ 1415 1415 scan_large_block(_sdata, _edata); 1416 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 1419 #ifdef CONFIG_SMP 1419 1420 /* per-cpu sections scanning */
+5 -7
mm/memory-failure.c
··· 1112 1112 } 1113 1113 1114 1114 if (!PageHuge(p) && PageTransHuge(hpage)) { 1115 - lock_page(hpage); 1116 - if (!PageAnon(hpage) || unlikely(split_huge_page(hpage))) { 1117 - unlock_page(hpage); 1118 - if (!PageAnon(hpage)) 1115 + lock_page(p); 1116 + if (!PageAnon(p) || unlikely(split_huge_page(p))) { 1117 + unlock_page(p); 1118 + if (!PageAnon(p)) 1119 1119 pr_err("Memory failure: %#lx: non anonymous thp\n", 1120 1120 pfn); 1121 1121 else ··· 1126 1126 put_hwpoison_page(p); 1127 1127 return -EBUSY; 1128 1128 } 1129 - unlock_page(hpage); 1130 - get_hwpoison_page(p); 1131 - put_hwpoison_page(hpage); 1129 + unlock_page(p); 1132 1130 VM_BUG_ON_PAGE(!page_count(p), p); 1133 1131 hpage = compound_head(p); 1134 1132 }
+1 -1
mm/page_alloc.c
··· 3658 3658 /* Make sure we know about allocations which stall for too long */ 3659 3659 if (time_after(jiffies, alloc_start + stall_timeout)) { 3660 3660 warn_alloc(gfp_mask, 3661 - "page alloction stalls for %ums, order:%u\n", 3661 + "page allocation stalls for %ums, order:%u", 3662 3662 jiffies_to_msecs(jiffies-alloc_start), order); 3663 3663 stall_timeout += 10 * HZ; 3664 3664 }
+2
mm/shmem.c
··· 1483 1483 copy_highpage(newpage, oldpage); 1484 1484 flush_dcache_page(newpage); 1485 1485 1486 + __SetPageLocked(newpage); 1487 + __SetPageSwapBacked(newpage); 1486 1488 SetPageUptodate(newpage); 1487 1489 set_page_private(newpage, swap_index); 1488 1490 SetPageSwapCache(newpage);
+2 -2
mm/slab_common.c
··· 533 533 534 534 s = create_cache(cache_name, root_cache->object_size, 535 535 root_cache->size, root_cache->align, 536 - root_cache->flags, root_cache->ctor, 537 - memcg, root_cache); 536 + root_cache->flags & CACHE_CREATE_MASK, 537 + root_cache->ctor, memcg, root_cache); 538 538 /* 539 539 * If we could not create a memcg cache, do not complain, because 540 540 * that's not critical at all as we can always proceed with the root
+2
mm/swapfile.c
··· 2224 2224 swab32s(&swap_header->info.version); 2225 2225 swab32s(&swap_header->info.last_page); 2226 2226 swab32s(&swap_header->info.nr_badpages); 2227 + if (swap_header->info.nr_badpages > MAX_SWAP_BADPAGES) 2228 + return 0; 2227 2229 for (i = 0; i < swap_header->info.nr_badpages; i++) 2228 2230 swab32s(&swap_header->info.badpages[i]); 2229 2231 }
+3
scripts/bloat-o-meter
··· 8 8 # of the GNU General Public License, incorporated herein by reference. 9 9 10 10 import sys, os, re 11 + from signal import signal, SIGPIPE, SIG_DFL 12 + 13 + signal(SIGPIPE, SIG_DFL) 11 14 12 15 if len(sys.argv) != 3: 13 16 sys.stderr.write("usage: %s file1 file2\n" % sys.argv[0])