Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1423836 > unrolled thread

Re: [PATCH 10/27] mm, vmscan: Clear congestion, dirty and need for compaction on a per-node basis

Started byVlastimil Babka <vbabka@suse.cz>
First post2016-06-16 11:30 +0200
Last post2016-06-16 12:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 10/27] mm, vmscan: Clear congestion, dirty and need for  compaction on a per-node basis Vlastimil Babka <vbabka@suse.cz> - 2016-06-16 11:30 +0200
    Re: [PATCH 10/27] mm, vmscan: Clear congestion, dirty and need for  compaction on a per-node basis Mel Gorman <mgorman@techsingularity.net> - 2016-06-16 12:30 +0200

#1423836 — Re: [PATCH 10/27] mm, vmscan: Clear congestion, dirty and need for compaction on a per-node basis

FromVlastimil Babka <vbabka@suse.cz>
Date2016-06-16 11:30 +0200
SubjectRe: [PATCH 10/27] mm, vmscan: Clear congestion, dirty and need for compaction on a per-node basis
Message-ID<rKBMB-6A6-1@gated-at.bofh.it>
On 06/09/2016 08:04 PM, Mel Gorman wrote:
> Congested and dirty tracking of a node and whether reclaim should stall
> is still based on zone activity. This patch considers whether the kernel
> should stall based on node-based reclaim activity.

I'm a bit confused about the description vs actual code.
It appears to move some duplicated code to a related function, which is 
fine. The rest of callsites that didn't perform the clearing before 
(prepare_kswapd_sleep() and wakeup_kswapd()) might be a bit overkill, 
but won't hurt. But I don't see the part "considers whether the kernel
should stall based on node-based reclaim activity". Is something missing?

> Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
> ---
>  mm/vmscan.c | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index dd68e3154732..e4f3e068b7a0 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -2966,7 +2966,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;
>  }
>
>  /*
> @@ -3112,13 +3122,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);
>  			}
>  		}
>
> @@ -3177,11 +3180,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;
> -			}
>  		}
>
>  		/*
>

[toc] | [next] | [standalone]


#1423908

FromMel Gorman <mgorman@techsingularity.net>
Date2016-06-16 12:30 +0200
Message-ID<rKCIF-78J-1@gated-at.bofh.it>
In reply to#1423836
On Thu, Jun 16, 2016 at 11:29:00AM +0200, Vlastimil Babka wrote:
> On 06/09/2016 08:04 PM, Mel Gorman wrote:
> >Congested and dirty tracking of a node and whether reclaim should stall
> >is still based on zone activity. This patch considers whether the kernel
> >should stall based on node-based reclaim activity.
> 
> I'm a bit confused about the description vs actual code.
> It appears to move some duplicated code to a related function, which is
> fine. The rest of callsites that didn't perform the clearing before
> (prepare_kswapd_sleep() and wakeup_kswapd()) might be a bit overkill, but
> won't hurt. But I don't see the part "considers whether the kernel
> should stall based on node-based reclaim activity". Is something missing?
> 

Tired when writing the changelog. Does this make more sense?

    mm, vmscan: Remove duplicate logic clearing node congestion and dirty state

    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.

-- 
Mel Gorman
SUSE Labs

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web