From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753081AbcD1Igk (ORCPT ); Thu, 28 Apr 2016 04:36:40 -0400 Received: from mx2.suse.de ([195.135.220.15]:59319 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752972AbcD1Igi (ORCPT ); Thu, 28 Apr 2016 04:36:38 -0400 Subject: Re: [PATCH 06/27] mm, vmscan: Make kswapd reclaim in terms of nodes To: Mel Gorman , Andrew Morton , Linux-MM References: <1460711613-2761-1-git-send-email-mgorman@techsingularity.net> <1460711613-2761-7-git-send-email-mgorman@techsingularity.net> Cc: Rik van Riel , Johannes Weiner , Jesper Dangaard Brouer , LKML From: Vlastimil Babka Message-ID: <5721CB93.8000207@suse.cz> Date: Thu, 28 Apr 2016 10:36:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <1460711613-2761-7-git-send-email-mgorman@techsingularity.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/15/2016 11:13 AM, Mel Gorman wrote: > /* > - * If a zone reaches its high watermark, consider it to be no longer > - * congested. It's possible there are dirty pages backed by congested > - * BDIs but as pressure is relieved, speculatively avoid congestion > - * waits. > + * Fragmentation may mean that the system cannot be rebalanced for > + * high-order allocations. If twice the allocation size has been > + * reclaimed then recheck watermarks only at order-0 to prevent > + * excessive reclaim. Assume that a process requested a high-order > + * can direct reclaim/compact. Also kcompactd is woken up in this case... > */ > - if (pgdat_reclaimable(zone->zone_pgdat) && > - zone_balanced(zone, sc->order, false, 0, classzone_idx)) { > - clear_bit(PGDAT_CONGESTED, &pgdat->flags); > - clear_bit(PGDAT_DIRTY, &pgdat->flags); > - } > + if (sc->order && sc->nr_reclaimed >= 2UL << sc->order) > + sc->order = 0; > > return sc->nr_scanned >= sc->nr_to_reclaim; This looks indeed simpler than my earlier zone_balanced() modification you removed. However I think there's still potential of overreclaim due to a stream of kswapd_wakeups where each will have to reclaim 2UL << sc->order pages, regardless of watermarks. Could be some high-order wakeups from GFP_ATOMIC context that have order-0 fallbacks but will cause kswapd to keep reclaiming when kcompactd can't keep up due to fragmentation...