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

Showing the changes to kernel/fork.c (1 of 1 file). Show all

Unified · Split

kernel/fork.c+0−5
@@ -755,11 +755,6 @@ static void check_mm(struct mm_struct *mm) · 754 unmodified lines
755 for (i = 0; i < NR_MM_COUNTERS; i++) {755 for (i = 0; i < NR_MM_COUNTERS; i++) {
756 long x = percpu_counter_sum(&mm->rss_stat[i]);756 long x = percpu_counter_sum(&mm->rss_stat[i]);
757 757
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]);
763 if (unlikely(x))758 if (unlikely(x))
764 pr_alert("BUG: Bad rss-counter state mm:%p type:%s val:%ld\n",759 pr_alert("BUG: Bad rss-counter state mm:%p type:%s val:%ld\n",
765 mm, resident_page_types[i], x);760 mm, resident_page_types[i], x);