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 tag 'mm-hotfixes-stable-2024-02-10-11-16' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull misc fixes from Andrew Morton:
"21 hotfixes. 12 are cc:stable and the remainder pertain to post-6.7
issues or aren't considered to be needed in earlier kernel versions"

* tag 'mm-hotfixes-stable-2024-02-10-11-16' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (21 commits)
nilfs2: fix potential bug in end_buffer_async_write
mm/damon/sysfs-schemes: fix wrong DAMOS tried regions update timeout setup
nilfs2: fix hang in nilfs_lookup_dirty_data_buffers()
MAINTAINERS: Leo Yan has moved
mm/zswap: don't return LRU_SKIP if we have dropped lru lock
fs,hugetlb: fix NULL pointer dereference in hugetlbs_fill_super
mailmap: switch email address for John Moon
mm: zswap: fix objcg use-after-free in entry destruction
mm/madvise: don't forget to leave lazy MMU mode in madvise_cold_or_pageout_pte_range()
arch/arm/mm: fix major fault accounting when retrying under per-VMA lock
selftests: core: include linux/close_range.h for CLOSE_RANGE_* macros
mm/memory-failure: fix crash in split_huge_page_to_list from soft_offline_page
mm: memcg: optimize parent iteration in memcg_rstat_updated()
nilfs2: fix data corruption in dsync block recovery for small block sizes
mm/userfaultfd: UFFDIO_MOVE implementation should use ptep_get()
exit: wait_task_zombie: kill the no longer necessary spin_lock_irq(siglock)
fs/proc: do_task_stat: use sig->stats_lock to gather the threads/children stats
fs/proc: do_task_stat: move thread_group_cputime_adjusted() outside of lock_task_sighand()
getrusage: use sig->stats_lock rather than lock_task_sighand()
getrusage: move thread_group_cputime_adjusted() outside of lock_task_sighand()
...

+164 -103
+2
.mailmap
··· 289 289 John Crispin <john@phrozen.org> <blogic@openwrt.org> 290 290 John Fastabend <john.fastabend@gmail.com> <john.r.fastabend@intel.com> 291 291 John Keeping <john@keeping.me.uk> <john@metanate.com> 292 + John Moon <john@jmoon.dev> <quic_johmoo@quicinc.com> 292 293 John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> 293 294 John Stultz <johnstul@us.ibm.com> 294 295 <jon.toppins+linux@gmail.com> <jtoppins@cumulusnetworks.com> ··· 345 344 Leon Romanovsky <leon@kernel.org> <leon@leon.nu> 346 345 Leon Romanovsky <leon@kernel.org> <leonro@mellanox.com> 347 346 Leon Romanovsky <leon@kernel.org> <leonro@nvidia.com> 347 + Leo Yan <leo.yan@linux.dev> <leo.yan@linaro.org> 348 348 Liam Mark <quic_lmark@quicinc.com> <lmark@codeaurora.org> 349 349 Linas Vepstas <linas@austin.ibm.com> 350 350 Linus Lüssing <linus.luessing@c0d3.blue> <linus.luessing@ascom.ch>
+1 -1
MAINTAINERS
··· 17182 17182 R: Will Deacon <will@kernel.org> 17183 17183 R: James Clark <james.clark@arm.com> 17184 17184 R: Mike Leach <mike.leach@linaro.org> 17185 - R: Leo Yan <leo.yan@linaro.org> 17185 + R: Leo Yan <leo.yan@linux.dev> 17186 17186 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 17187 17187 S: Supported 17188 17188 F: tools/build/feature/test-libopencsd.c
+2
arch/arm/mm/fault.c
··· 298 298 goto done; 299 299 } 300 300 count_vm_vma_lock_event(VMA_LOCK_RETRY); 301 + if (fault & VM_FAULT_MAJOR) 302 + flags |= FAULT_FLAG_TRIED; 301 303 302 304 /* Quick path to respond to signals */ 303 305 if (fault_signal_pending(fault, regs)) {
+16 -3
fs/hugetlbfs/inode.c
··· 100 100 loff_t len, vma_len; 101 101 int ret; 102 102 struct hstate *h = hstate_file(file); 103 + vm_flags_t vm_flags; 103 104 104 105 /* 105 106 * vma address alignment (but not the pgoff alignment) has ··· 142 141 file_accessed(file); 143 142 144 143 ret = -ENOMEM; 144 + 145 + vm_flags = vma->vm_flags; 146 + /* 147 + * for SHM_HUGETLB, the pages are reserved in the shmget() call so skip 148 + * reserving here. Note: only for SHM hugetlbfs file, the inode 149 + * flag S_PRIVATE is set. 150 + */ 151 + if (inode->i_flags & S_PRIVATE) 152 + vm_flags |= VM_NORESERVE; 153 + 145 154 if (!hugetlb_reserve_pages(inode, 146 155 vma->vm_pgoff >> huge_page_order(h), 147 156 len >> huge_page_shift(h), vma, 148 - vma->vm_flags)) 157 + vm_flags)) 149 158 goto out; 150 159 151 160 ret = 0; ··· 1365 1354 { 1366 1355 struct hugetlbfs_fs_context *ctx = fc->fs_private; 1367 1356 struct fs_parse_result result; 1357 + struct hstate *h; 1368 1358 char *rest; 1369 1359 unsigned long ps; 1370 1360 int opt; ··· 1410 1398 1411 1399 case Opt_pagesize: 1412 1400 ps = memparse(param->string, &rest); 1413 - ctx->hstate = size_to_hstate(ps); 1414 - if (!ctx->hstate) { 1401 + h = size_to_hstate(ps); 1402 + if (!h) { 1415 1403 pr_err("Unsupported page size %lu MB\n", ps / SZ_1M); 1416 1404 return -EINVAL; 1417 1405 } 1406 + ctx->hstate = h; 1418 1407 return 0; 1419 1408 1420 1409 case Opt_min_size:
+7 -1
fs/nilfs2/file.c
··· 107 107 nilfs_transaction_commit(inode->i_sb); 108 108 109 109 mapped: 110 - folio_wait_stable(folio); 110 + /* 111 + * Since checksumming including data blocks is performed to determine 112 + * the validity of the log to be written and used for recovery, it is 113 + * necessary to wait for writeback to finish here, regardless of the 114 + * stable write requirement of the backing device. 115 + */ 116 + folio_wait_writeback(folio); 111 117 out: 112 118 sb_end_pagefault(inode->i_sb); 113 119 return vmf_fs_error(ret);
+4 -3
fs/nilfs2/recovery.c
··· 472 472 473 473 static int nilfs_recovery_copy_block(struct the_nilfs *nilfs, 474 474 struct nilfs_recovery_block *rb, 475 - struct page *page) 475 + loff_t pos, struct page *page) 476 476 { 477 477 struct buffer_head *bh_org; 478 + size_t from = pos & ~PAGE_MASK; 478 479 void *kaddr; 479 480 480 481 bh_org = __bread(nilfs->ns_bdev, rb->blocknr, nilfs->ns_blocksize); ··· 483 482 return -EIO; 484 483 485 484 kaddr = kmap_atomic(page); 486 - memcpy(kaddr + bh_offset(bh_org), bh_org->b_data, bh_org->b_size); 485 + memcpy(kaddr + from, bh_org->b_data, bh_org->b_size); 487 486 kunmap_atomic(kaddr); 488 487 brelse(bh_org); 489 488 return 0; ··· 522 521 goto failed_inode; 523 522 } 524 523 525 - err = nilfs_recovery_copy_block(nilfs, rb, page); 524 + err = nilfs_recovery_copy_block(nilfs, rb, pos, page); 526 525 if (unlikely(err)) 527 526 goto failed_page; 528 527
+5 -3
fs/nilfs2/segment.c
··· 1703 1703 1704 1704 list_for_each_entry(bh, &segbuf->sb_payload_buffers, 1705 1705 b_assoc_buffers) { 1706 - set_buffer_async_write(bh); 1707 1706 if (bh == segbuf->sb_super_root) { 1708 1707 if (bh->b_folio != bd_folio) { 1709 1708 folio_lock(bd_folio); ··· 1713 1714 } 1714 1715 break; 1715 1716 } 1717 + set_buffer_async_write(bh); 1716 1718 if (bh->b_folio != fs_folio) { 1717 1719 nilfs_begin_folio_io(fs_folio); 1718 1720 fs_folio = bh->b_folio; ··· 1800 1800 1801 1801 list_for_each_entry(bh, &segbuf->sb_payload_buffers, 1802 1802 b_assoc_buffers) { 1803 - clear_buffer_async_write(bh); 1804 1803 if (bh == segbuf->sb_super_root) { 1805 1804 clear_buffer_uptodate(bh); 1806 1805 if (bh->b_folio != bd_folio) { ··· 1808 1809 } 1809 1810 break; 1810 1811 } 1812 + clear_buffer_async_write(bh); 1811 1813 if (bh->b_folio != fs_folio) { 1812 1814 nilfs_end_folio_io(fs_folio, err); 1813 1815 fs_folio = bh->b_folio; ··· 1896 1896 BIT(BH_Delay) | BIT(BH_NILFS_Volatile) | 1897 1897 BIT(BH_NILFS_Redirected)); 1898 1898 1899 - set_mask_bits(&bh->b_state, clear_bits, set_bits); 1900 1899 if (bh == segbuf->sb_super_root) { 1900 + set_buffer_uptodate(bh); 1901 + clear_buffer_dirty(bh); 1901 1902 if (bh->b_folio != bd_folio) { 1902 1903 folio_end_writeback(bd_folio); 1903 1904 bd_folio = bh->b_folio; ··· 1906 1905 update_sr = true; 1907 1906 break; 1908 1907 } 1908 + set_mask_bits(&bh->b_state, clear_bits, set_bits); 1909 1909 if (bh->b_folio != fs_folio) { 1910 1910 nilfs_end_folio_io(fs_folio, 0); 1911 1911 fs_folio = bh->b_folio;
+37 -29
fs/proc/array.c
··· 477 477 int permitted; 478 478 struct mm_struct *mm; 479 479 unsigned long long start_time; 480 - unsigned long cmin_flt = 0, cmaj_flt = 0; 481 - unsigned long min_flt = 0, maj_flt = 0; 482 - u64 cutime, cstime, utime, stime; 483 - u64 cgtime, gtime; 480 + unsigned long cmin_flt, cmaj_flt, min_flt, maj_flt; 481 + u64 cutime, cstime, cgtime, utime, stime, gtime; 484 482 unsigned long rsslim = 0; 485 483 unsigned long flags; 486 484 int exit_code = task->exit_code; 485 + struct signal_struct *sig = task->signal; 486 + unsigned int seq = 1; 487 487 488 488 state = *get_task_state(task); 489 489 vsize = eip = esp = 0; ··· 511 511 512 512 sigemptyset(&sigign); 513 513 sigemptyset(&sigcatch); 514 - cutime = cstime = utime = stime = 0; 515 - cgtime = gtime = 0; 516 514 517 515 if (lock_task_sighand(task, &flags)) { 518 - struct signal_struct *sig = task->signal; 519 - 520 516 if (sig->tty) { 521 517 struct pid *pgrp = tty_get_pgrp(sig->tty); 522 518 tty_pgrp = pid_nr_ns(pgrp, ns); ··· 523 527 num_threads = get_nr_threads(task); 524 528 collect_sigign_sigcatch(task, &sigign, &sigcatch); 525 529 526 - cmin_flt = sig->cmin_flt; 527 - cmaj_flt = sig->cmaj_flt; 528 - cutime = sig->cutime; 529 - cstime = sig->cstime; 530 - cgtime = sig->cgtime; 531 530 rsslim = READ_ONCE(sig->rlim[RLIMIT_RSS].rlim_cur); 532 531 533 - /* add up live thread stats at the group level */ 534 532 if (whole) { 535 - struct task_struct *t; 536 - 537 - __for_each_thread(sig, t) { 538 - min_flt += t->min_flt; 539 - maj_flt += t->maj_flt; 540 - gtime += task_gtime(t); 541 - } 542 - 543 - min_flt += sig->min_flt; 544 - maj_flt += sig->maj_flt; 545 - thread_group_cputime_adjusted(task, &utime, &stime); 546 - gtime += sig->gtime; 547 - 548 533 if (sig->flags & (SIGNAL_GROUP_EXIT | SIGNAL_STOP_STOPPED)) 549 534 exit_code = sig->group_exit_code; 550 535 } ··· 539 562 540 563 if (permitted && (!whole || num_threads < 2)) 541 564 wchan = !task_is_running(task); 542 - if (!whole) { 565 + 566 + do { 567 + seq++; /* 2 on the 1st/lockless path, otherwise odd */ 568 + flags = read_seqbegin_or_lock_irqsave(&sig->stats_lock, &seq); 569 + 570 + cmin_flt = sig->cmin_flt; 571 + cmaj_flt = sig->cmaj_flt; 572 + cutime = sig->cutime; 573 + cstime = sig->cstime; 574 + cgtime = sig->cgtime; 575 + 576 + if (whole) { 577 + struct task_struct *t; 578 + 579 + min_flt = sig->min_flt; 580 + maj_flt = sig->maj_flt; 581 + gtime = sig->gtime; 582 + 583 + rcu_read_lock(); 584 + __for_each_thread(sig, t) { 585 + min_flt += t->min_flt; 586 + maj_flt += t->maj_flt; 587 + gtime += task_gtime(t); 588 + } 589 + rcu_read_unlock(); 590 + } 591 + } while (need_seqretry(&sig->stats_lock, seq)); 592 + done_seqretry_irqrestore(&sig->stats_lock, seq, flags); 593 + 594 + if (whole) { 595 + thread_group_cputime_adjusted(task, &utime, &stime); 596 + } else { 597 + task_cputime_adjusted(task, &utime, &stime); 543 598 min_flt = task->min_flt; 544 599 maj_flt = task->maj_flt; 545 - task_cputime_adjusted(task, &utime, &stime); 546 600 gtime = task_gtime(task); 547 601 } 548 602
+3 -7
kernel/exit.c
··· 1127 1127 * and nobody can change them. 1128 1128 * 1129 1129 * psig->stats_lock also protects us from our sub-threads 1130 - * which can reap other children at the same time. Until 1131 - * we change k_getrusage()-like users to rely on this lock 1132 - * we have to take ->siglock as well. 1130 + * which can reap other children at the same time. 1133 1131 * 1134 1132 * We use thread_group_cputime_adjusted() to get times for 1135 1133 * the thread group, which consolidates times for all threads 1136 1134 * in the group including the group leader. 1137 1135 */ 1138 1136 thread_group_cputime_adjusted(p, &tgutime, &tgstime); 1139 - spin_lock_irq(&current->sighand->siglock); 1140 - write_seqlock(&psig->stats_lock); 1137 + write_seqlock_irq(&psig->stats_lock); 1141 1138 psig->cutime += tgutime + sig->cutime; 1142 1139 psig->cstime += tgstime + sig->cstime; 1143 1140 psig->cgtime += task_gtime(p) + sig->gtime + sig->cgtime; ··· 1157 1160 psig->cmaxrss = maxrss; 1158 1161 task_io_accounting_add(&psig->ioac, &p->ioac); 1159 1162 task_io_accounting_add(&psig->ioac, &sig->ioac); 1160 - write_sequnlock(&psig->stats_lock); 1161 - spin_unlock_irq(&current->sighand->siglock); 1163 + write_sequnlock_irq(&psig->stats_lock); 1162 1164 } 1163 1165 1164 1166 if (wo->wo_rusage)
+34 -20
kernel/sys.c
··· 1785 1785 struct task_struct *t; 1786 1786 unsigned long flags; 1787 1787 u64 tgutime, tgstime, utime, stime; 1788 - unsigned long maxrss = 0; 1788 + unsigned long maxrss; 1789 + struct mm_struct *mm; 1789 1790 struct signal_struct *sig = p->signal; 1791 + unsigned int seq = 0; 1790 1792 1791 - memset((char *)r, 0, sizeof (*r)); 1793 + retry: 1794 + memset(r, 0, sizeof(*r)); 1792 1795 utime = stime = 0; 1796 + maxrss = 0; 1793 1797 1794 1798 if (who == RUSAGE_THREAD) { 1795 1799 task_cputime_adjusted(current, &utime, &stime); 1796 1800 accumulate_thread_rusage(p, r); 1797 1801 maxrss = sig->maxrss; 1798 - goto out; 1802 + goto out_thread; 1799 1803 } 1800 1804 1801 - if (!lock_task_sighand(p, &flags)) 1802 - return; 1805 + flags = read_seqbegin_or_lock_irqsave(&sig->stats_lock, &seq); 1803 1806 1804 1807 switch (who) { 1805 1808 case RUSAGE_BOTH: ··· 1822 1819 fallthrough; 1823 1820 1824 1821 case RUSAGE_SELF: 1825 - thread_group_cputime_adjusted(p, &tgutime, &tgstime); 1826 - utime += tgutime; 1827 - stime += tgstime; 1828 1822 r->ru_nvcsw += sig->nvcsw; 1829 1823 r->ru_nivcsw += sig->nivcsw; 1830 1824 r->ru_minflt += sig->min_flt; ··· 1830 1830 r->ru_oublock += sig->oublock; 1831 1831 if (maxrss < sig->maxrss) 1832 1832 maxrss = sig->maxrss; 1833 + 1834 + rcu_read_lock(); 1833 1835 __for_each_thread(sig, t) 1834 1836 accumulate_thread_rusage(t, r); 1837 + rcu_read_unlock(); 1838 + 1835 1839 break; 1836 1840 1837 1841 default: 1838 1842 BUG(); 1839 1843 } 1840 - unlock_task_sighand(p, &flags); 1841 1844 1842 - out: 1845 + if (need_seqretry(&sig->stats_lock, seq)) { 1846 + seq = 1; 1847 + goto retry; 1848 + } 1849 + done_seqretry_irqrestore(&sig->stats_lock, seq, flags); 1850 + 1851 + if (who == RUSAGE_CHILDREN) 1852 + goto out_children; 1853 + 1854 + thread_group_cputime_adjusted(p, &tgutime, &tgstime); 1855 + utime += tgutime; 1856 + stime += tgstime; 1857 + 1858 + out_thread: 1859 + mm = get_task_mm(p); 1860 + if (mm) { 1861 + setmax_mm_hiwater_rss(&maxrss, mm); 1862 + mmput(mm); 1863 + } 1864 + 1865 + out_children: 1866 + r->ru_maxrss = maxrss * (PAGE_SIZE / 1024); /* convert pages to KBs */ 1843 1867 r->ru_utime = ns_to_kernel_old_timeval(utime); 1844 1868 r->ru_stime = ns_to_kernel_old_timeval(stime); 1845 - 1846 - if (who != RUSAGE_CHILDREN) { 1847 - struct mm_struct *mm = get_task_mm(p); 1848 - 1849 - if (mm) { 1850 - setmax_mm_hiwater_rss(&maxrss, mm); 1851 - mmput(mm); 1852 - } 1853 - } 1854 - r->ru_maxrss = maxrss * (PAGE_SIZE / 1024); /* convert pages to KBs */ 1855 1869 } 1856 1870 1857 1871 SYSCALL_DEFINE2(getrusage, int, who, struct rusage __user *, ru)
+1 -1
mm/damon/sysfs-schemes.c
··· 2194 2194 sysfs_regions->upd_timeout_jiffies = jiffies + 2195 2195 2 * usecs_to_jiffies(scheme->apply_interval_us ? 2196 2196 scheme->apply_interval_us : 2197 - ctx->attrs.sample_interval); 2197 + ctx->attrs.aggr_interval); 2198 2198 } 2199 2199 } 2200 2200
+1
mm/madvise.c
··· 429 429 if (++batch_count == SWAP_CLUSTER_MAX) { 430 430 batch_count = 0; 431 431 if (need_resched()) { 432 + arch_leave_lazy_mmu_mode(); 432 433 pte_unmap_unlock(start_pte, ptl); 433 434 cond_resched(); 434 435 goto restart;
+35 -21
mm/memcontrol.c
··· 621 621 } 622 622 623 623 struct memcg_vmstats_percpu { 624 + /* Stats updates since the last flush */ 625 + unsigned int stats_updates; 626 + 627 + /* Cached pointers for fast iteration in memcg_rstat_updated() */ 628 + struct memcg_vmstats_percpu *parent; 629 + struct memcg_vmstats *vmstats; 630 + 631 + /* The above should fit a single cacheline for memcg_rstat_updated() */ 632 + 624 633 /* Local (CPU and cgroup) page state & events */ 625 634 long state[MEMCG_NR_STAT]; 626 635 unsigned long events[NR_MEMCG_EVENTS]; ··· 641 632 /* Cgroup1: threshold notifications & softlimit tree updates */ 642 633 unsigned long nr_page_events; 643 634 unsigned long targets[MEM_CGROUP_NTARGETS]; 644 - 645 - /* Stats updates since the last flush */ 646 - unsigned int stats_updates; 647 - }; 635 + } ____cacheline_aligned; 648 636 649 637 struct memcg_vmstats { 650 638 /* Aggregated (CPU and subtree) page state & events */ ··· 704 698 } 705 699 706 700 707 - static bool memcg_should_flush_stats(struct mem_cgroup *memcg) 701 + static bool memcg_vmstats_needs_flush(struct memcg_vmstats *vmstats) 708 702 { 709 - return atomic64_read(&memcg->vmstats->stats_updates) > 703 + return atomic64_read(&vmstats->stats_updates) > 710 704 MEMCG_CHARGE_BATCH * num_online_cpus(); 711 705 } 712 706 713 707 static inline void memcg_rstat_updated(struct mem_cgroup *memcg, int val) 714 708 { 709 + struct memcg_vmstats_percpu *statc; 715 710 int cpu = smp_processor_id(); 716 - unsigned int x; 717 711 718 712 if (!val) 719 713 return; 720 714 721 715 cgroup_rstat_updated(memcg->css.cgroup, cpu); 722 - 723 - for (; memcg; memcg = parent_mem_cgroup(memcg)) { 724 - x = __this_cpu_add_return(memcg->vmstats_percpu->stats_updates, 725 - abs(val)); 726 - 727 - if (x < MEMCG_CHARGE_BATCH) 716 + statc = this_cpu_ptr(memcg->vmstats_percpu); 717 + for (; statc; statc = statc->parent) { 718 + statc->stats_updates += abs(val); 719 + if (statc->stats_updates < MEMCG_CHARGE_BATCH) 728 720 continue; 729 721 730 722 /* 731 723 * If @memcg is already flush-able, increasing stats_updates is 732 724 * redundant. Avoid the overhead of the atomic update. 733 725 */ 734 - if (!memcg_should_flush_stats(memcg)) 735 - atomic64_add(x, &memcg->vmstats->stats_updates); 736 - __this_cpu_write(memcg->vmstats_percpu->stats_updates, 0); 726 + if (!memcg_vmstats_needs_flush(statc->vmstats)) 727 + atomic64_add(statc->stats_updates, 728 + &statc->vmstats->stats_updates); 729 + statc->stats_updates = 0; 737 730 } 738 731 } 739 732 ··· 761 756 if (!memcg) 762 757 memcg = root_mem_cgroup; 763 758 764 - if (memcg_should_flush_stats(memcg)) 759 + if (memcg_vmstats_needs_flush(memcg->vmstats)) 765 760 do_flush_stats(memcg); 766 761 } 767 762 ··· 775 770 static void flush_memcg_stats_dwork(struct work_struct *w) 776 771 { 777 772 /* 778 - * Deliberately ignore memcg_should_flush_stats() here so that flushing 773 + * Deliberately ignore memcg_vmstats_needs_flush() here so that flushing 779 774 * in latency-sensitive paths is as cheap as possible. 780 775 */ 781 776 do_flush_stats(root_mem_cgroup); ··· 5482 5477 __mem_cgroup_free(memcg); 5483 5478 } 5484 5479 5485 - static struct mem_cgroup *mem_cgroup_alloc(void) 5480 + static struct mem_cgroup *mem_cgroup_alloc(struct mem_cgroup *parent) 5486 5481 { 5482 + struct memcg_vmstats_percpu *statc, *pstatc; 5487 5483 struct mem_cgroup *memcg; 5488 - int node; 5484 + int node, cpu; 5489 5485 int __maybe_unused i; 5490 5486 long error = -ENOMEM; 5491 5487 ··· 5509 5503 GFP_KERNEL_ACCOUNT); 5510 5504 if (!memcg->vmstats_percpu) 5511 5505 goto fail; 5506 + 5507 + for_each_possible_cpu(cpu) { 5508 + if (parent) 5509 + pstatc = per_cpu_ptr(parent->vmstats_percpu, cpu); 5510 + statc = per_cpu_ptr(memcg->vmstats_percpu, cpu); 5511 + statc->parent = parent ? pstatc : NULL; 5512 + statc->vmstats = memcg->vmstats; 5513 + } 5512 5514 5513 5515 for_each_node(node) 5514 5516 if (alloc_mem_cgroup_per_node_info(memcg, node)) ··· 5563 5549 struct mem_cgroup *memcg, *old_memcg; 5564 5550 5565 5551 old_memcg = set_active_memcg(parent); 5566 - memcg = mem_cgroup_alloc(); 5552 + memcg = mem_cgroup_alloc(parent); 5567 5553 set_active_memcg(old_memcg); 5568 5554 if (IS_ERR(memcg)) 5569 5555 return ERR_CAST(memcg);
+3
mm/memory-failure.c
··· 1377 1377 */ 1378 1378 static inline bool HWPoisonHandlable(struct page *page, unsigned long flags) 1379 1379 { 1380 + if (PageSlab(page)) 1381 + return false; 1382 + 1380 1383 /* Soft offline could migrate non-LRU movable pages */ 1381 1384 if ((flags & MF_SOFT_OFFLINE) && __PageMovable(page)) 1382 1385 return true;
+7 -7
mm/userfaultfd.c
··· 902 902 903 903 double_pt_lock(dst_ptl, src_ptl); 904 904 905 - if (!pte_same(*src_pte, orig_src_pte) || 906 - !pte_same(*dst_pte, orig_dst_pte)) { 905 + if (!pte_same(ptep_get(src_pte), orig_src_pte) || 906 + !pte_same(ptep_get(dst_pte), orig_dst_pte)) { 907 907 err = -EAGAIN; 908 908 goto out; 909 909 } ··· 946 946 947 947 double_pt_lock(dst_ptl, src_ptl); 948 948 949 - if (!pte_same(*src_pte, orig_src_pte) || 950 - !pte_same(*dst_pte, orig_dst_pte)) { 949 + if (!pte_same(ptep_get(src_pte), orig_src_pte) || 950 + !pte_same(ptep_get(dst_pte), orig_dst_pte)) { 951 951 double_pt_unlock(dst_ptl, src_ptl); 952 952 return -EAGAIN; 953 953 } ··· 1016 1016 } 1017 1017 1018 1018 spin_lock(dst_ptl); 1019 - orig_dst_pte = *dst_pte; 1019 + orig_dst_pte = ptep_get(dst_pte); 1020 1020 spin_unlock(dst_ptl); 1021 1021 if (!pte_none(orig_dst_pte)) { 1022 1022 err = -EEXIST; ··· 1024 1024 } 1025 1025 1026 1026 spin_lock(src_ptl); 1027 - orig_src_pte = *src_pte; 1027 + orig_src_pte = ptep_get(src_pte); 1028 1028 spin_unlock(src_ptl); 1029 1029 if (pte_none(orig_src_pte)) { 1030 1030 if (!(mode & UFFDIO_MOVE_MODE_ALLOW_SRC_HOLES)) ··· 1054 1054 * page isn't freed under us 1055 1055 */ 1056 1056 spin_lock(src_ptl); 1057 - if (!pte_same(orig_src_pte, *src_pte)) { 1057 + if (!pte_same(orig_src_pte, ptep_get(src_pte))) { 1058 1058 spin_unlock(src_ptl); 1059 1059 err = -EAGAIN; 1060 1060 goto out;
+5 -7
mm/zswap.c
··· 536 536 */ 537 537 static void zswap_free_entry(struct zswap_entry *entry) 538 538 { 539 - if (entry->objcg) { 540 - obj_cgroup_uncharge_zswap(entry->objcg, entry->length); 541 - obj_cgroup_put(entry->objcg); 542 - } 543 539 if (!entry->length) 544 540 atomic_dec(&zswap_same_filled_pages); 545 541 else { ··· 543 547 zpool_free(zswap_find_zpool(entry), entry->handle); 544 548 atomic_dec(&entry->pool->nr_stored); 545 549 zswap_pool_put(entry->pool); 550 + } 551 + if (entry->objcg) { 552 + obj_cgroup_uncharge_zswap(entry->objcg, entry->length); 553 + obj_cgroup_put(entry->objcg); 546 554 } 547 555 zswap_entry_cache_free(entry); 548 556 atomic_dec(&zswap_stored_pages); ··· 895 895 * into the warmer region. We should terminate shrinking (if we're in the dynamic 896 896 * shrinker context). 897 897 */ 898 - if (writeback_result == -EEXIST && encountered_page_in_swapcache) { 899 - ret = LRU_SKIP; 898 + if (writeback_result == -EEXIST && encountered_page_in_swapcache) 900 899 *encountered_page_in_swapcache = true; 901 - } 902 900 903 901 goto put_unlock; 904 902 }
+1
tools/testing/selftests/core/close_range_test.c
··· 12 12 #include <syscall.h> 13 13 #include <unistd.h> 14 14 #include <sys/resource.h> 15 + #include <linux/close_range.h> 15 16 16 17 #include "../kselftest_harness.h" 17 18 #include "../clone3/clone3_selftests.h"