From patchwork Tue Aug 28 20:13:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 145369 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp1589487ljw; Tue, 28 Aug 2018 13:14:13 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYxzTGcw/Jv5Ryl/7FqiJOipFvI/xW8g1jHtDDn8Sg5ZjMfg6jBR/3Wa0PGYRFH9USGeLR2 X-Received: by 2002:a63:cb0f:: with SMTP id p15-v6mr2933439pgg.197.1535487252888; Tue, 28 Aug 2018 13:14:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535487252; cv=none; d=google.com; s=arc-20160816; b=wGoeWfzHZdiiY34XQGKmegn5AX9DbisF3LbU6/dyxHQuMGtA9eALRIi6lATPM95MNV eg1clAT/fa5EabzZrZ+mi9Hhblp5QOIvjW49gBEgNMoEnp9IBBAf/iu5gKwZzic+gL3y EHvpsdGtbqqVP1VuiQVVnW7V7Qnmcl3PCawETn8kSFj63hHUzDbwxxVYuov0lnfJnI2Z f2n5SJhlCm/6YdPtQHkBOlHYVRBKliMLTrhMhjX/7KUVVxubyrqT0dPcKEalnK5LYwP/ SfR+uxorIOPEgd8KJxkGxvGFbFsBdnbFHa9sgIWVL7ZyG4L6wylmky/cnN8z1hZdBLXT AV0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=eQ/m9DUVdjAicHlgJxoQOKTZjadCXQDS84km0LuGv28=; b=fkOg7wYLq/Ihv3L6WDzOQNq7a6NUNZZVJZTSWysIL+CSF0QZDGpsmH8OgQOBDyg0Pr lCBM/jyCn2OLkohCIpubvOSWu4a/5ClF7qrRkB/sTFKRFMejyUdbJHlarc7viIMFYnZc txfqr1zH0soLYwg0MWrZ9aApgBSPLrynSSTyGVPWkD579e43ikYjG1xo6S92aUgTvEX7 eSd2j8NY3zLgvJknI/K5tj/k0Fu8gBUajyyBULh3FPqs1lCf3U8iKGIzQAU7F++oBXnC o/zoj5dC6fMyD6D5PuvOxW15/KAKObYfNZO2mtaeCNDUzIyRtBdbDvqTvQ7Po0n7zlXd c/5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Znt5YZ3m; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y10-v6si1906969pgf.312.2018.08.28.13.14.12; Tue, 28 Aug 2018 13:14:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Znt5YZ3m; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727199AbeH2AH0 (ORCPT + 13 others); Tue, 28 Aug 2018 20:07:26 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:37266 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726961AbeH2AH0 (ORCPT ); Tue, 28 Aug 2018 20:07:26 -0400 Received: by mail-pg1-f193.google.com with SMTP id 2-v6so717748pgo.4 for ; Tue, 28 Aug 2018 13:14:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eQ/m9DUVdjAicHlgJxoQOKTZjadCXQDS84km0LuGv28=; b=Znt5YZ3mFIC5ZwbY5gDF4rrln4fKwT14+YwK9Ob25fOXnb8SA+CmhTD/+WQE0ST+nA cMowuqAIV93WDIG0ZcgULi6ilknFRwlJv15q54wFZt5Zzu8/Ur5jUu/fIriD3ag+blD8 z/9uvgOLxr7c0ZOoiSqVGxcUBu5rmsKKxES7I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=eQ/m9DUVdjAicHlgJxoQOKTZjadCXQDS84km0LuGv28=; b=UZlBqLP6p4qg8svZMFO63rjyAE8LqTatvjYTFWIyATEg8mAZxjaRvYkDAKlXH8ER7q ZamM0r41rZIZ8LSJrU21g1jLGhuk/78pBZ4od9eDpmYFWAE77TRksvl/eELLPLyjDsWN e5nmq7rceXEmLmbKevq4iC5HCIyiKdMRsmOTKK+bCekFEMsqG77Kv/j9FOKJza9CHsqN DzFqb92c0RNZA7r9bckL5QWVJo9ookj6Je2gtgj6/pSXoUQso2t5ho3hKUaseYX8KVLj fx4Cva2hTJ6ErAeIBkSIW14qCsx4PheWTuHsnnZRgbR5t+W21j8PzbTwaDCyB56bhocd xOIQ== X-Gm-Message-State: APzg51C83Uei42G2yVrCAQR5k6XzkE/BvnWwDiiR65YY5MEV9DAhARXq 90t2I9x5z3KH0UefK8JF7s42b8gAZO5iDw== X-Received: by 2002:a62:411a:: with SMTP id o26-v6mr2995128pfa.111.1535487251160; Tue, 28 Aug 2018 13:14:11 -0700 (PDT) Received: from localhost.localdomain ([49.207.48.21]) by smtp.gmail.com with ESMTPSA id t86-v6sm3098181pfe.109.2018.08.28.13.14.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 28 Aug 2018 13:14:10 -0700 (PDT) From: Amit Pundir To: Greg KH Cc: Stable , Mel Gorman , Minchan Kim , Rik van Riel , Andrew Morton , Linus Torvalds Subject: [PATCH for-4.9.y 13/14] mm, vmscan: clear PGDAT_WRITEBACK when zone is balanced Date: Wed, 29 Aug 2018 01:43:24 +0530 Message-Id: <1535487205-26280-14-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535487205-26280-1-git-send-email-amit.pundir@linaro.org> References: <1535487205-26280-1-git-send-email-amit.pundir@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Mel Gorman commit c2f83143f1c67d186520b72b6cefbf0aa07a34ee upstream. Hillf Danton pointed out that since commit 1d82de618dd ("mm, vmscan: make kswapd reclaim in terms of nodes") that PGDAT_WRITEBACK is no longer cleared. It was not noticed as triggering it requires pages under writeback to cycle twice through the LRU and before kswapd gets stalled. Historically, such issues tended to occur on small machines writing heavily to slow storage such as a USB stick. Once kswapd stalls, direct reclaim stalls may be higher but due to the fact that memory pressure is required, it would not be very noticable. Michal Hocko suggested removing the flag entirely but the conservative fix is to restore the intended PGDAT_WRITEBACK behaviour and clear the flag when a suitable zone is balanced. Fixes: 1d82de618ddd ("mm, vmscan: make kswapd reclaim in terms of nodes") Link: http://lkml.kernel.org/r/20170203203222.gq7hk66yc36lpgtb@suse.de Signed-off-by: Mel Gorman Acked-by: Johannes Weiner Acked-by: Michal Hocko Acked-by: Hillf Danton Cc: Minchan Kim Cc: Rik van Riel Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Amit Pundir --- mm/vmscan.c | 1 + 1 file changed, 1 insertion(+) -- 2.7.4 diff --git a/mm/vmscan.c b/mm/vmscan.c index f03ca5ab86b1..cfffef1f26a8 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -3123,6 +3123,7 @@ static bool zone_balanced(struct zone *zone, int order, int classzone_idx) */ clear_bit(PGDAT_CONGESTED, &zone->zone_pgdat->flags); clear_bit(PGDAT_DIRTY, &zone->zone_pgdat->flags); + clear_bit(PGDAT_WRITEBACK, &zone->zone_pgdat->flags); return true; }