History

fork: remove use of percpu_counter_sum_all

This effectively reverts the change made in commit f689054aace2 ("percpu_counter: add percpu_counter_sum_all interface") as the race condition percpu_counter_sum_all() was invented to avoid is now handled directly in percpu_counter_sum() and nobody needs to care about summing racing with cpu unplug anymore.

Dave Chinner committed 3 years ago

Commit 7ba85fb1 parent 8b57b111 file · +0 −5Browse files

Unified · Split

kernel/fork.c+0−5
@@ -755,11 +755,6 @@ static void check_mm(struct mm_struct *mm) · 754 unmodified lines
755755 for (i = 0; i < NR_MM_COUNTERS; i++) {
756756 long x = percpu_counter_sum(&mm->rss_stat[i]);
757757
758− if (likely(!x))
759− continue;
760−
761− /* Making sure this is not due to race with CPU offlining. */
762− x = percpu_counter_sum_all(&mm->rss_stat[i]);
763758 if (unlikely(x))
764759 pr_alert("BUG: Bad rss-counter state mm:%p type:%s val:%ld\n",
765760 mm, resident_page_types[i], x);