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