Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp253891pxb; Tue, 19 Oct 2021 02:06:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyL/4oC8u/6/RVRXQ932B/XoXozAF7T3sDGustXBRHt5qJtIU75EKmy39kxJIW6B/r+wKUP X-Received: by 2002:aa7:978b:0:b0:44c:abf1:a8b8 with SMTP id o11-20020aa7978b000000b0044cabf1a8b8mr34464610pfp.35.1634634370568; Tue, 19 Oct 2021 02:06:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634634370; cv=none; d=google.com; s=arc-20160816; b=KbXwGt8RJcgEQRFsB66iCyg4V/kXn5YEhVMjpgYoVTu2e3sRz9n9Ek7wF37aTncYpS fiypywoHFNmEPpXcCRFspCgCXQ95Scei+K269HPm4VIE+WYg6lgZbFGFJRGzyzDnjWMl uXc4uXv53P82QBg8S3nYdbcIYmurFxdXy7GzHbJ3vzXjSuWNVDfDrDn3O/3YG+XKidFT GSEGflJ0l/2FNEA+7TOxS6ZIUNtxAH0hPM7/R1wJIvPsESMigWnj53N32uLRJHMBFOo5 bLhKiJxIzjwwgKYD4pKjivfxpDixvngUsXsHmboi+hSKNxS/q4f+UomgDvO56RNBkAAP BQvg== 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=v+7vEDuBYmYPo0rFMl3Rly9ZY9HMNrMQFOxgKK6P0Aw=; b=NM5a2goXRGsReSp8cEB6zOKqhm5R1/GP9ML0xq9kNIQLbu7x/ZRJEzXQNFndTiVm7c cIFSi3uLEtxQwd5Ru7hOu1dmlhovfWIAVjF/AA39yCQ7FXdzDf0eZ9iKqKRzeOLAMoM8 kQj7x0gKW3aMaLlb5JG7LR+ZHmT+wGu9RpciZlKAv/NfyQzTkruMF7zQiNPCS7V4aUQt EwXGtTp1TzSTkg44SEFa1nCziJi614NZ99pQb3HGhl8w1Ep5WgkCzma/79Zom254UMpL 2Ddu38UGO1AJMa9rNWBGygWyrhHTaaqYRNI5+hFiblpjOpox4lnrbcH5SxTcQORvmbuS LiUQ== 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 mw15si3330287pjb.180.2021.10.19.02.05.57; Tue, 19 Oct 2021 02:06:10 -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 S234680AbhJSJE4 (ORCPT + 99 others); Tue, 19 Oct 2021 05:04:56 -0400 Received: from outbound-smtp21.blacknight.com ([81.17.249.41]:42345 "EHLO outbound-smtp21.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234980AbhJSJEz (ORCPT ); Tue, 19 Oct 2021 05:04:55 -0400 Received: from mail.blacknight.com (pemlinmail01.blacknight.ie [81.17.254.10]) by outbound-smtp21.blacknight.com (Postfix) with ESMTPS id 21B78CCC44 for ; Tue, 19 Oct 2021 10:02:41 +0100 (IST) Received: (qmail 10926 invoked from network); 19 Oct 2021 09:02:40 -0000 Received: from unknown (HELO stampy.112glenside.lan) (mgorman@techsingularity.net@[84.203.17.29]) by 81.17.254.9 with ESMTPA; 19 Oct 2021 09:02:40 -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: Tue, 19 Oct 2021 10:01:08 +0100 Message-Id: <20211019090108.25501-9-mgorman@techsingularity.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211019090108.25501-1-mgorman@techsingularity.net> References: <20211019090108.25501-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 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index ec2006680242..28adc196353d 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1057,7 +1057,7 @@ void reclaim_throttle(pg_data_t *pgdat, enum vmscan_throttle_state reason) ret = schedule_timeout(timeout); finish_wait(wqh, &wait); - if (reason == VMSCAN_THROTTLE_ISOLATED) + if (reason == VMSCAN_THROTTLE_WRITEBACK) atomic_dec(&pgdat->nr_writeback_throttled); trace_mm_vmscan_throttled(pgdat->node_id, jiffies_to_usecs(timeout), @@ -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