diff options
| author | Wolfram Sang <wsa@kernel.org> | 2023-04-24 12:50:20 +0200 |
|---|---|---|
| committer | Wolfram Sang <wsa@kernel.org> | 2023-04-24 12:50:20 +0200 |
| commit | 38c87827ffd3c7e1dd61eee9a7dea13d487dc2ed (patch) | |
| tree | e6bd1c3ae56823874a736c1512409c123c9a4219 /kernel/fork.c | |
| parent | 9496fffcb28f39e0352779a0199b6e61861c9221 (diff) | |
| parent | d663d93bb47e7ab45602b227701022d8aa16040a (diff) | |
Merge branch 'i2c/for-current' into i2c/for-mergewindow
This should have been in 6.3, but sadly I missed it.
Diffstat (limited to 'kernel/fork.c')
| -rw-r--r-- | kernel/fork.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/kernel/fork.c b/kernel/fork.c index d8cda4c6de6c..0c92f224c68c 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -617,6 +617,7 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm, if (retval) goto out; + mt_clear_in_rcu(vmi.mas.tree); for_each_vma(old_vmi, mpnt) { struct file *file; @@ -700,6 +701,8 @@ static __latent_entropy int dup_mmap(struct mm_struct *mm, retval = arch_dup_mmap(oldmm, mm); loop_out: vma_iter_free(&vmi); + if (!retval) + mt_set_in_rcu(vmi.mas.tree); out: mmap_write_unlock(mm); flush_tlb_mm(oldmm); @@ -755,11 +758,6 @@ static void check_mm(struct mm_struct *mm) for (i = 0; i < NR_MM_COUNTERS; i++) { long x = percpu_counter_sum(&mm->rss_stat[i]); - if (likely(!x)) - continue; - - /* Making sure this is not due to race with CPU offlining. */ - x = percpu_counter_sum_all(&mm->rss_stat[i]); if (unlikely(x)) pr_alert("BUG: Bad rss-counter state mm:%p type:%s val:%ld\n", mm, resident_page_types[i], x); |
