Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1796501pxb; Fri, 22 Oct 2021 07:51:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3ycqGCPFzaUDxGleUjhFGKiw6v8bvbQf2/G97cbVT4SAl8lWslzIV+oxoqV+96YSEGDuJ X-Received: by 2002:a17:90b:38c6:: with SMTP id nn6mr419848pjb.206.1634914272943; Fri, 22 Oct 2021 07:51:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634914272; cv=none; d=google.com; s=arc-20160816; b=dmGREmdHPEbni8tw1Bz7b5lQMaK+t4V4BaZ7ccSmoCmnbg30U9uClYVO2ieSxkSgfs aB4WHp3M9Nv+Ve+63BA3ehE2rQVpbiDZ51rPUFmc+8ZCQY8WR0jW2cL0lmWlpj69XtjH SICkOVXjLyI5MIAB9IjK4rtyJGj/CjHSWheel1gLi4A3EVNZ+BCu5KUln5Riq015Fr4C uBw6e8rqsJCgCo7hG32gMQ5jTmhuJTjlFdKjWJ6T3wrJhsPWIb39446QIYSsPWx/an6a Dh7XkRGrlvV6pDVONBeIyW7yxSZgZDFI/YB+57rkkE6716QvVrxIRoc6LFnhH+TmZADe YDqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=NJf58wgmRX7bgWpFBqS88JguyBWI0yCRM2s+vKSqKRE=; b=kCZ/tNVQ1wygleyNxflWqYiO5yk4ziOk5QkE/bm2kR/4Y9y3OTxwLi0ZX0qwUqTON6 Iqvlq5JrA6fq0qbTUkHRgWN7cOcqFWxqMyVxpT9lcfXKZlWpWWZ4rU3BDwUsCX1eCwcz m6fDQWri2Cqm/jxdA//xjcB97u6+49i5Hhj9MS632rnlq3XujLfIDNYM6rpPfi/rv0xC adtfkWFl8Nq26MHSX70Kjdoi2Pg8ltn78eAiP5dqZWXPKeSbpK4btVfvXFr6kZrJnjD3 5NxMKuzBOSkZlcmspLx4y/ksP/Q2mA+C8djWZvNZlAgZQe+onagZWTFtGv0TcI2sndv5 oLXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v22si155353pgb.417.2021.10.22.07.50.56; Fri, 22 Oct 2021 07:51:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233096AbhJVOum (ORCPT + 99 others); Fri, 22 Oct 2021 10:50:42 -0400 Received: from outbound-smtp45.blacknight.com ([46.22.136.57]:39051 "EHLO outbound-smtp45.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233224AbhJVOum (ORCPT ); Fri, 22 Oct 2021 10:50:42 -0400 Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp45.blacknight.com (Postfix) with ESMTPS id C519EFB3DF for ; Fri, 22 Oct 2021 15:48:23 +0100 (IST) Received: (qmail 32390 invoked from network); 22 Oct 2021 14:48:23 -0000 Received: from unknown (HELO stampy.112glenside.lan) (mgorman@techsingularity.net@[84.203.17.29]) by 81.17.254.9 with ESMTPA; 22 Oct 2021 14:48:23 -0000 From: Mel Gorman To: Andrew Morton Cc: NeilBrown , Theodore Ts'o , Andreas Dilger , "Darrick J . Wong" , Matthew Wilcox , Michal Hocko , Dave Chinner , Rik van Riel , Vlastimil Babka , Johannes Weiner , Jonathan Corbet , Linux-MM , Linux-fsdevel , LKML , Mel Gorman Subject: [PATCH 8/8] mm/vmscan: Delay waking of tasks throttled on NOPROGRESS Date: Fri, 22 Oct 2021 15:46:51 +0100 Message-Id: <20211022144651.19914-9-mgorman@techsingularity.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211022144651.19914-1-mgorman@techsingularity.net> References: <20211022144651.19914-1-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tracing indicates that tasks throttled on NOPROGRESS are woken prematurely resulting in occasional massive spikes in direct reclaim activity. This patch wakes tasks throttled on NOPROGRESS if reclaim efficiency is at least 12%. Signed-off-by: Mel Gorman Acked-by: Vlastimil Babka --- mm/vmscan.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 35b6ccaa01c3..812d4697d50d 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -3349,8 +3349,11 @@ static inline bool compaction_ready(struct zone *zone, struct scan_control *sc) static void consider_reclaim_throttle(pg_data_t *pgdat, struct scan_control *sc) { - /* If reclaim is making progress, wake any throttled tasks. */ - if (sc->nr_reclaimed) { + /* + * If reclaim is making progress greater than 12% efficiency then + * wake all the NOPROGRESS throttled tasks. + */ + if (sc->nr_reclaimed > (sc->nr_scanned >> 3)) { wait_queue_head_t *wqh; wqh = &pgdat->reclaim_wait[VMSCAN_THROTTLE_NOPROGRESS]; -- 2.31.1