writeback: skip tmpfs early in balance_dirty_pages_ratelimited_nr()
authorWu Fengguang <fengguang.wu@intel.com>
Sat, 11 Jun 2011 23:53:57 +0000 (17:53 -0600)
committerWu Fengguang <fengguang.wu@intel.com>
Sun, 19 Jun 2011 16:25:46 +0000 (00:25 +0800)
This helps prevent tmpfs dirtiers from skewing the per-cpu bdp_ratelimits.

Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
mm/page-writeback.c

index b2529f8f8be0c04628a61de2622ade3d24186983..1965d05a29ccc458751a57d43067b952e398b280 100644 (file)
@@ -490,9 +490,6 @@ static void balance_dirty_pages(struct address_space *mapping,
        bool dirty_exceeded = false;
        struct backing_dev_info *bdi = mapping->backing_dev_info;
 
-       if (!bdi_cap_account_dirty(bdi))
-               return;
-
        for (;;) {
                struct writeback_control wbc = {
                        .sync_mode      = WB_SYNC_NONE,
@@ -631,9 +628,13 @@ static DEFINE_PER_CPU(unsigned long, bdp_ratelimits) = 0;
 void balance_dirty_pages_ratelimited_nr(struct address_space *mapping,
                                        unsigned long nr_pages_dirtied)
 {
+       struct backing_dev_info *bdi = mapping->backing_dev_info;
        unsigned long ratelimit;
        unsigned long *p;
 
+       if (!bdi_cap_account_dirty(bdi))
+               return;
+
        ratelimit = ratelimit_pages;
        if (mapping->backing_dev_info->dirty_exceeded)
                ratelimit = 8;