From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758762AbcB1QQ6 (ORCPT ); Sun, 28 Feb 2016 11:16:58 -0500 Received: from gum.cmpxchg.org ([85.214.110.215]:60944 "EHLO gum.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758666AbcB1QQ5 (ORCPT ); Sun, 28 Feb 2016 11:16:57 -0500 Date: Sun, 28 Feb 2016 11:16:44 -0500 From: Johannes Weiner To: Mel Gorman Cc: Linux-MM , Rik van Riel , Vlastimil Babka , LKML Subject: Re: [PATCH 08/27] mm, vmscan: Make kswapd reclaim in terms of nodes Message-ID: <20160228161644.GC25622@cmpxchg.org> References: <1456239890-20737-1-git-send-email-mgorman@techsingularity.net> <1456239890-20737-9-git-send-email-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1456239890-20737-9-git-send-email-mgorman@techsingularity.net> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 23, 2016 at 03:04:31PM +0000, Mel Gorman wrote: > @@ -3299,20 +3191,37 @@ static int balance_pgdat(pg_data_t *pgdat, int order, int classzone_idx) > break; > > /* > + * Stop reclaiming if any eligible zone is balanced and clear > + * node writeback or congested. > + */ > + for (i = 0; i <= classzone_idx; i++) { > + zone = pgdat->node_zones + i; > + if (!populated_zone(zone)) > + continue; > + > + if (zone_balanced(zone, sc.order, 0, classzone_idx)) { > + clear_bit(PGDAT_CONGESTED, &pgdat->flags); > + clear_bit(PGDAT_DIRTY, &pgdat->flags); > + goto out; > + } > + } > + > + /* > * Raise priority if scanning rate is too low or there was no > * progress in reclaiming pages > */ > if (raise_priority || !sc.nr_reclaimed) > sc.priority--; > - } while (sc.priority >= 1 && > - !pgdat_balanced(pgdat, order, classzone_idx)); > + } while (sc.priority >= 1); > > out: > /* > - * Return the highest zone idx we were reclaiming at so > - * prepare_kswapd_sleep() makes the same decisions as here. > + * Return the order we were reclaiming at so prepare_kswapd_sleep() > + * makes a decision on the order we were last reclaiming at. However, > + * if another caller entered the allocator slow path while kswapd > + * was awake, order will remain at the higher level > */ > - return end_zone; > + return order; It's sc.order that's updated based on fragmentation, not order. There is also a now-stale comment above the function saying it returns the highest reclaimed zone index. Otherwise, the patch looks good to me. Acked-by: Johannes Weiner