aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page-writeback.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/page-writeback.c')
-rw-r--r--mm/page-writeback.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 25e7770309b8..dd73d29c15a8 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -604,6 +604,8 @@ void set_page_dirty_balance(struct page *page, int page_mkwrite)
604 } 604 }
605} 605}
606 606
607static DEFINE_PER_CPU(unsigned long, bdp_ratelimits) = 0;
608
607/** 609/**
608 * balance_dirty_pages_ratelimited_nr - balance dirty memory state 610 * balance_dirty_pages_ratelimited_nr - balance dirty memory state
609 * @mapping: address_space which was dirtied 611 * @mapping: address_space which was dirtied
@@ -621,7 +623,6 @@ void set_page_dirty_balance(struct page *page, int page_mkwrite)
621void balance_dirty_pages_ratelimited_nr(struct address_space *mapping, 623void balance_dirty_pages_ratelimited_nr(struct address_space *mapping,
622 unsigned long nr_pages_dirtied) 624 unsigned long nr_pages_dirtied)
623{ 625{
624 static DEFINE_PER_CPU(unsigned long, ratelimits) = 0;
625 unsigned long ratelimit; 626 unsigned long ratelimit;
626 unsigned long *p; 627 unsigned long *p;
627 628
@@ -634,7 +635,7 @@ void balance_dirty_pages_ratelimited_nr(struct address_space *mapping,
634 * tasks in balance_dirty_pages(). Period. 635 * tasks in balance_dirty_pages(). Period.
635 */ 636 */
636 preempt_disable(); 637 preempt_disable();
637 p = &__get_cpu_var(ratelimits); 638 p = &__get_cpu_var(bdp_ratelimits);
638 *p += nr_pages_dirtied; 639 *p += nr_pages_dirtied;
639 if (unlikely(*p >= ratelimit)) { 640 if (unlikely(*p >= ratelimit)) {
640 *p = 0; 641 *p = 0;