lkml.org 
[lkml]   [2016]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 10/31] mm, vmscan: remove duplicate logic clearing node congestion and dirty state
    Date
    Reclaim may stall if there is too much dirty or congested data on a node.
    This was previously based on zone flags and the logic for clearing the
    flags is in two places. As congestion/dirty tracking is now tracked on a
    per-node basis, we can remove some duplicate logic.

    Link: http://lkml.kernel.org/r/1466518566-30034-11-git-send-email-mgorman@techsingularity.net
    Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    Cc: Vlastimil Babka <vbabka@suse.cz>
    Cc: Rik van Riel <riel@surriel.com>
    Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
    ---
    mm/vmscan.c | 24 ++++++++++++------------
    1 file changed, 12 insertions(+), 12 deletions(-)

    diff --git a/mm/vmscan.c b/mm/vmscan.c
    index 34656173a670..911142d25de2 100644
    --- a/mm/vmscan.c
    +++ b/mm/vmscan.c
    @@ -3005,7 +3005,17 @@ static bool zone_balanced(struct zone *zone, int order, int classzone_idx)
    {
    unsigned long mark = high_wmark_pages(zone);

    - return zone_watermark_ok_safe(zone, order, mark, classzone_idx);
    + if (!zone_watermark_ok_safe(zone, order, mark, classzone_idx))
    + return false;
    +
    + /*
    + * If any eligible zone is balanced then the node is not considered
    + * to be congested or dirty
    + */
    + clear_bit(PGDAT_CONGESTED, &zone->zone_pgdat->flags);
    + clear_bit(PGDAT_DIRTY, &zone->zone_pgdat->flags);
    +
    + return true;
    }

    /*
    @@ -3151,13 +3161,6 @@ static int balance_pgdat(pg_data_t *pgdat, int order, int classzone_idx)
    if (!zone_balanced(zone, order, 0)) {
    classzone_idx = i;
    break;
    - } else {
    - /*
    - * If any eligible zone is balanced then the
    - * node is not considered congested or dirty.
    - */
    - clear_bit(PGDAT_CONGESTED, &zone->zone_pgdat->flags);
    - clear_bit(PGDAT_DIRTY, &zone->zone_pgdat->flags);
    }
    }

    @@ -3216,11 +3219,8 @@ static int balance_pgdat(pg_data_t *pgdat, int order, int classzone_idx)
    if (!populated_zone(zone))
    continue;

    - if (zone_balanced(zone, sc.order, classzone_idx)) {
    - clear_bit(PGDAT_CONGESTED, &pgdat->flags);
    - clear_bit(PGDAT_DIRTY, &pgdat->flags);
    + if (zone_balanced(zone, sc.order, classzone_idx))
    goto out;
    - }
    }

    /*
    --
    2.6.4
    \
     
     \ /
      Last update: 2016-07-01 18:21    [W:3.198 / U:0.048 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site