Message ID | 20230315084938.2544737-4-david@fromorbit.com (mailing list archive) |
---|---|
State | Mainlined, archived |
Headers | show |
Series | pcpctr: fix percpu_counter_sum vs cpu offline race | expand |
diff --git a/kernel/fork.c b/kernel/fork.c index d8cda4c6de6c..c0257cbee093 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -755,11 +755,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);