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 fixes from Andrew Morton:
"15 patches.

Subsystems affected by this patch series: mailmap, mm/hotfixes,
mm/thp, mm/memory-hotplug, misc, kcsan"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
kcsan: kconfig: move to menu 'Generic Kernel Debugging Instruments'
fs/fs-writeback.c: adjust dirtytime_interval_handler definition to match prototype
stackleak: let stack_erasing_sysctl take a kernel pointer buffer
ftrace: let ftrace_enable_sysctl take a kernel pointer buffer
mm/memory_hotplug: drain per-cpu pages again during memory offline
selftests/vm: fix display of page size in map_hugetlb
mm/thp: fix __split_huge_pmd_locked() for migration PMD
kprobes: fix kill kprobe which has been marked as gone
tmpfs: restore functionality of nr_inodes=0
mlock: fix unevictable_pgs event counts on THP
mm: fix check_move_unevictable_pages() on THP
mm: migration of hugetlbfs page skip memcg
ksm: reinstate memcg charge on copied pages
mailmap: add older email addresses for Kees Cook

+102 -50
+4
.mailmap
··· 169 169 Julien Thierry <julien.thierry.kdev@gmail.com> <julien.thierry@arm.com> 170 170 Kamil Konieczny <k.konieczny@samsung.com> <k.konieczny@partner.samsung.com> 171 171 Kay Sievers <kay.sievers@vrfy.org> 172 + Kees Cook <keescook@chromium.org> <kees.cook@canonical.com> 173 + Kees Cook <keescook@chromium.org> <keescook@google.com> 174 + Kees Cook <keescook@chromium.org> <kees@outflux.net> 175 + Kees Cook <keescook@chromium.org> <kees@ubuntu.com> 172 176 Kenneth W Chen <kenneth.w.chen@intel.com> 173 177 Konstantin Khlebnikov <koct9i@gmail.com> <khlebnikov@yandex-team.ru> 174 178 Konstantin Khlebnikov <koct9i@gmail.com> <k.khlebnikov@samsung.com>
+1 -1
fs/fs-writeback.c
··· 2184 2184 __initcall(start_dirtytime_writeback); 2185 2185 2186 2186 int dirtytime_interval_handler(struct ctl_table *table, int write, 2187 - void __user *buffer, size_t *lenp, loff_t *ppos) 2187 + void *buffer, size_t *lenp, loff_t *ppos) 2188 2188 { 2189 2189 int ret; 2190 2190
+1 -2
include/linux/ftrace.h
··· 85 85 extern int ftrace_enabled; 86 86 extern int 87 87 ftrace_enable_sysctl(struct ctl_table *table, int write, 88 - void __user *buffer, size_t *lenp, 89 - loff_t *ppos); 88 + void *buffer, size_t *lenp, loff_t *ppos); 90 89 91 90 struct ftrace_ops; 92 91
+1 -1
include/linux/stackleak.h
··· 25 25 26 26 #ifdef CONFIG_STACKLEAK_RUNTIME_DISABLE 27 27 int stack_erasing_sysctl(struct ctl_table *table, int write, 28 - void __user *buffer, size_t *lenp, loff_t *ppos); 28 + void *buffer, size_t *lenp, loff_t *ppos); 29 29 #endif 30 30 31 31 #else /* !CONFIG_GCC_PLUGIN_STACKLEAK */
+8 -1
kernel/kprobes.c
··· 2140 2140 2141 2141 lockdep_assert_held(&kprobe_mutex); 2142 2142 2143 + if (WARN_ON_ONCE(kprobe_gone(p))) 2144 + return; 2145 + 2143 2146 p->flags |= KPROBE_FLAG_GONE; 2144 2147 if (kprobe_aggrprobe(p)) { 2145 2148 /* ··· 2422 2419 mutex_lock(&kprobe_mutex); 2423 2420 for (i = 0; i < KPROBE_TABLE_SIZE; i++) { 2424 2421 head = &kprobe_table[i]; 2425 - hlist_for_each_entry(p, head, hlist) 2422 + hlist_for_each_entry(p, head, hlist) { 2423 + if (kprobe_gone(p)) 2424 + continue; 2425 + 2426 2426 if (within_module_init((unsigned long)p->addr, mod) || 2427 2427 (checkcore && 2428 2428 within_module_core((unsigned long)p->addr, mod))) { ··· 2442 2436 */ 2443 2437 kill_kprobe(p); 2444 2438 } 2439 + } 2445 2440 } 2446 2441 if (val == MODULE_STATE_GOING) 2447 2442 remove_module_kprobe_blacklist(mod);
+1 -1
kernel/stackleak.c
··· 20 20 static DEFINE_STATIC_KEY_FALSE(stack_erasing_bypass); 21 21 22 22 int stack_erasing_sysctl(struct ctl_table *table, int write, 23 - void __user *buffer, size_t *lenp, loff_t *ppos) 23 + void *buffer, size_t *lenp, loff_t *ppos) 24 24 { 25 25 int ret = 0; 26 26 int state = !static_branch_unlikely(&stack_erasing_bypass);
+1 -2
kernel/trace/ftrace.c
··· 7531 7531 7532 7532 int 7533 7533 ftrace_enable_sysctl(struct ctl_table *table, int write, 7534 - void __user *buffer, size_t *lenp, 7535 - loff_t *ppos) 7534 + void *buffer, size_t *lenp, loff_t *ppos) 7536 7535 { 7537 7536 int ret = -ENODEV; 7538 7537
+1 -3
lib/Kconfig.debug
··· 520 520 endchoice 521 521 522 522 source "lib/Kconfig.kgdb" 523 - 524 523 source "lib/Kconfig.ubsan" 524 + source "lib/Kconfig.kcsan" 525 525 526 526 endmenu 527 527 ··· 1619 1619 See Documentation/core-api/debugging-via-ohci1394.rst for more information. 1620 1620 1621 1621 source "samples/Kconfig" 1622 - 1623 - source "lib/Kconfig.kcsan" 1624 1622 1625 1623 config ARCH_HAS_DEVMEM_IS_ALLOWED 1626 1624 bool
+23 -19
mm/huge_memory.c
··· 2022 2022 put_page(page); 2023 2023 add_mm_counter(mm, mm_counter_file(page), -HPAGE_PMD_NR); 2024 2024 return; 2025 - } else if (is_huge_zero_pmd(*pmd)) { 2025 + } else if (pmd_trans_huge(*pmd) && is_huge_zero_pmd(*pmd)) { 2026 2026 /* 2027 2027 * FIXME: Do we want to invalidate secondary mmu by calling 2028 2028 * mmu_notifier_invalidate_range() see comments below inside ··· 2116 2116 pte = pte_offset_map(&_pmd, addr); 2117 2117 BUG_ON(!pte_none(*pte)); 2118 2118 set_pte_at(mm, addr, pte, entry); 2119 - atomic_inc(&page[i]._mapcount); 2119 + if (!pmd_migration) 2120 + atomic_inc(&page[i]._mapcount); 2120 2121 pte_unmap(pte); 2121 2122 } 2122 2123 2123 - /* 2124 - * Set PG_double_map before dropping compound_mapcount to avoid 2125 - * false-negative page_mapped(). 2126 - */ 2127 - if (compound_mapcount(page) > 1 && !TestSetPageDoubleMap(page)) { 2128 - for (i = 0; i < HPAGE_PMD_NR; i++) 2129 - atomic_inc(&page[i]._mapcount); 2130 - } 2131 - 2132 - lock_page_memcg(page); 2133 - if (atomic_add_negative(-1, compound_mapcount_ptr(page))) { 2134 - /* Last compound_mapcount is gone. */ 2135 - __dec_lruvec_page_state(page, NR_ANON_THPS); 2136 - if (TestClearPageDoubleMap(page)) { 2137 - /* No need in mapcount reference anymore */ 2124 + if (!pmd_migration) { 2125 + /* 2126 + * Set PG_double_map before dropping compound_mapcount to avoid 2127 + * false-negative page_mapped(). 2128 + */ 2129 + if (compound_mapcount(page) > 1 && 2130 + !TestSetPageDoubleMap(page)) { 2138 2131 for (i = 0; i < HPAGE_PMD_NR; i++) 2139 - atomic_dec(&page[i]._mapcount); 2132 + atomic_inc(&page[i]._mapcount); 2140 2133 } 2134 + 2135 + lock_page_memcg(page); 2136 + if (atomic_add_negative(-1, compound_mapcount_ptr(page))) { 2137 + /* Last compound_mapcount is gone. */ 2138 + __dec_lruvec_page_state(page, NR_ANON_THPS); 2139 + if (TestClearPageDoubleMap(page)) { 2140 + /* No need in mapcount reference anymore */ 2141 + for (i = 0; i < HPAGE_PMD_NR; i++) 2142 + atomic_dec(&page[i]._mapcount); 2143 + } 2144 + } 2145 + unlock_page_memcg(page); 2141 2146 } 2142 - unlock_page_memcg(page); 2143 2147 2144 2148 smp_wmb(); /* make pte visible before pmd */ 2145 2149 pmd_populate(mm, pmd, pgtable);
+4
mm/ksm.c
··· 2586 2586 return page; /* let do_swap_page report the error */ 2587 2587 2588 2588 new_page = alloc_page_vma(GFP_HIGHUSER_MOVABLE, vma, address); 2589 + if (new_page && mem_cgroup_charge(new_page, vma->vm_mm, GFP_KERNEL)) { 2590 + put_page(new_page); 2591 + new_page = NULL; 2592 + } 2589 2593 if (new_page) { 2590 2594 copy_user_highpage(new_page, page, address, vma); 2591 2595
+14
mm/memory_hotplug.c
··· 1575 1575 /* check again */ 1576 1576 ret = walk_system_ram_range(start_pfn, end_pfn - start_pfn, 1577 1577 NULL, check_pages_isolated_cb); 1578 + /* 1579 + * per-cpu pages are drained in start_isolate_page_range, but if 1580 + * there are still pages that are not free, make sure that we 1581 + * drain again, because when we isolated range we might 1582 + * have raced with another thread that was adding pages to pcp 1583 + * list. 1584 + * 1585 + * Forward progress should be still guaranteed because 1586 + * pages on the pcp list can only belong to MOVABLE_ZONE 1587 + * because has_unmovable_pages explicitly checks for 1588 + * PageBuddy on freed pages on other zones. 1589 + */ 1590 + if (ret) 1591 + drain_all_pages(zone); 1578 1592 } while (ret); 1579 1593 1580 1594 /* Ok, all of our target is isolated.
+2 -1
mm/migrate.c
··· 668 668 669 669 copy_page_owner(page, newpage); 670 670 671 - mem_cgroup_migrate(page, newpage); 671 + if (!PageHuge(page)) 672 + mem_cgroup_migrate(page, newpage); 672 673 } 673 674 EXPORT_SYMBOL(migrate_page_states); 674 675
+15 -9
mm/mlock.c
··· 58 58 */ 59 59 void clear_page_mlock(struct page *page) 60 60 { 61 + int nr_pages; 62 + 61 63 if (!TestClearPageMlocked(page)) 62 64 return; 63 65 64 - mod_zone_page_state(page_zone(page), NR_MLOCK, -thp_nr_pages(page)); 65 - count_vm_event(UNEVICTABLE_PGCLEARED); 66 + nr_pages = thp_nr_pages(page); 67 + mod_zone_page_state(page_zone(page), NR_MLOCK, -nr_pages); 68 + count_vm_events(UNEVICTABLE_PGCLEARED, nr_pages); 66 69 /* 67 70 * The previous TestClearPageMlocked() corresponds to the smp_mb() 68 71 * in __pagevec_lru_add_fn(). ··· 79 76 * We lost the race. the page already moved to evictable list. 80 77 */ 81 78 if (PageUnevictable(page)) 82 - count_vm_event(UNEVICTABLE_PGSTRANDED); 79 + count_vm_events(UNEVICTABLE_PGSTRANDED, nr_pages); 83 80 } 84 81 } 85 82 ··· 96 93 VM_BUG_ON_PAGE(PageCompound(page) && PageDoubleMap(page), page); 97 94 98 95 if (!TestSetPageMlocked(page)) { 99 - mod_zone_page_state(page_zone(page), NR_MLOCK, 100 - thp_nr_pages(page)); 101 - count_vm_event(UNEVICTABLE_PGMLOCKED); 96 + int nr_pages = thp_nr_pages(page); 97 + 98 + mod_zone_page_state(page_zone(page), NR_MLOCK, nr_pages); 99 + count_vm_events(UNEVICTABLE_PGMLOCKED, nr_pages); 102 100 if (!isolate_lru_page(page)) 103 101 putback_lru_page(page); 104 102 } ··· 142 138 143 139 /* Did try_to_unlock() succeed or punt? */ 144 140 if (!PageMlocked(page)) 145 - count_vm_event(UNEVICTABLE_PGMUNLOCKED); 141 + count_vm_events(UNEVICTABLE_PGMUNLOCKED, thp_nr_pages(page)); 146 142 147 143 putback_lru_page(page); 148 144 } ··· 158 154 */ 159 155 static void __munlock_isolation_failed(struct page *page) 160 156 { 157 + int nr_pages = thp_nr_pages(page); 158 + 161 159 if (PageUnevictable(page)) 162 - __count_vm_event(UNEVICTABLE_PGSTRANDED); 160 + __count_vm_events(UNEVICTABLE_PGSTRANDED, nr_pages); 163 161 else 164 - __count_vm_event(UNEVICTABLE_PGMUNLOCKED); 162 + __count_vm_events(UNEVICTABLE_PGMUNLOCKED, nr_pages); 165 163 } 166 164 167 165 /**
+8
mm/page_isolation.c
··· 170 170 * pageblocks we may have modified and return -EBUSY to caller. This 171 171 * prevents two threads from simultaneously working on overlapping ranges. 172 172 * 173 + * Please note that there is no strong synchronization with the page allocator 174 + * either. Pages might be freed while their page blocks are marked ISOLATED. 175 + * In some cases pages might still end up on pcp lists and that would allow 176 + * for their allocation even when they are in fact isolated already. Depending 177 + * on how strong of a guarantee the caller needs drain_all_pages might be needed 178 + * (e.g. __offline_pages will need to call it after check for isolated range for 179 + * a next retry). 180 + * 173 181 * Return: the number of isolated pageblocks on success and -EBUSY if any part 174 182 * of range cannot be isolated. 175 183 */
+6 -4
mm/shmem.c
··· 279 279 280 280 if (!(sb->s_flags & SB_KERNMOUNT)) { 281 281 spin_lock(&sbinfo->stat_lock); 282 - if (!sbinfo->free_inodes) { 283 - spin_unlock(&sbinfo->stat_lock); 284 - return -ENOSPC; 282 + if (sbinfo->max_inodes) { 283 + if (!sbinfo->free_inodes) { 284 + spin_unlock(&sbinfo->stat_lock); 285 + return -ENOSPC; 286 + } 287 + sbinfo->free_inodes--; 285 288 } 286 - sbinfo->free_inodes--; 287 289 if (inop) { 288 290 ino = sbinfo->next_ino++; 289 291 if (unlikely(is_zero_ino(ino)))
+3 -3
mm/swap.c
··· 494 494 495 495 unevictable = (vma->vm_flags & (VM_LOCKED | VM_SPECIAL)) == VM_LOCKED; 496 496 if (unlikely(unevictable) && !TestSetPageMlocked(page)) { 497 + int nr_pages = thp_nr_pages(page); 497 498 /* 498 499 * We use the irq-unsafe __mod_zone_page_stat because this 499 500 * counter is not modified from interrupt context, and the pte 500 501 * lock is held(spinlock), which implies preemption disabled. 501 502 */ 502 - __mod_zone_page_state(page_zone(page), NR_MLOCK, 503 - thp_nr_pages(page)); 504 - count_vm_event(UNEVICTABLE_PGMLOCKED); 503 + __mod_zone_page_state(page_zone(page), NR_MLOCK, nr_pages); 504 + count_vm_events(UNEVICTABLE_PGMLOCKED, nr_pages); 505 505 } 506 506 lru_cache_add(page); 507 507 }
+8 -2
mm/vmscan.c
··· 4268 4268 for (i = 0; i < pvec->nr; i++) { 4269 4269 struct page *page = pvec->pages[i]; 4270 4270 struct pglist_data *pagepgdat = page_pgdat(page); 4271 + int nr_pages; 4271 4272 4272 - pgscanned++; 4273 + if (PageTransTail(page)) 4274 + continue; 4275 + 4276 + nr_pages = thp_nr_pages(page); 4277 + pgscanned += nr_pages; 4278 + 4273 4279 if (pagepgdat != pgdat) { 4274 4280 if (pgdat) 4275 4281 spin_unlock_irq(&pgdat->lru_lock); ··· 4294 4288 ClearPageUnevictable(page); 4295 4289 del_page_from_lru_list(page, lruvec, LRU_UNEVICTABLE); 4296 4290 add_page_to_lru_list(page, lruvec, lru); 4297 - pgrescued++; 4291 + pgrescued += nr_pages; 4298 4292 } 4299 4293 } 4300 4294
+1 -1
tools/testing/selftests/vm/map_hugetlb.c
··· 83 83 } 84 84 85 85 if (shift) 86 - printf("%u kB hugepages\n", 1 << shift); 86 + printf("%u kB hugepages\n", 1 << (shift - 10)); 87 87 else 88 88 printf("Default size hugepages\n"); 89 89 printf("Mapping %lu Mbytes\n", (unsigned long)length >> 20);