Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2391597pxb; Fri, 8 Oct 2021 06:56:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBsnWDq7AbtrXB8u7lS4M0/6Ef3qx4Wk7rjH8Y8jys2fDPYk4vxCTcFU2BUMALmIIQVxKO X-Received: by 2002:a17:902:bb94:b0:13c:9113:5652 with SMTP id m20-20020a170902bb9400b0013c91135652mr9705876pls.70.1633701415530; Fri, 08 Oct 2021 06:56:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633701415; cv=none; d=google.com; s=arc-20160816; b=MZb0GOoeIfaJCBzDDkKHAk7JuDy4vXE0xbtGX/xiBLbuKL+afYBUUuuond8isaIrAe lyTqSb9o1MwTs7QFOhKL3bUr4JsoZIVBAex2UAYuIrTaea+4F/4KEMEaxsrHPv593arJ eFVAObbtYMIBDP7MT6myT3JDjYMdaDi6bybBjx1+ytXUmGcORMlUkDbhzMrB3FpS9iQJ 0qjT/U9hUrEX0fyT3tok2u3eNpRwtkZielTFANqV5fkWdkSf+9Jpz5ECmGq4F1pgURtc kqDySM+cYshoNW1V7blwv482gTrIVNDaUcLyBotBJ0lMsZ2MvAf2n8XqGUNWM4KqTM0f LG8A== 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=XAfMkJ04O+Pfx7lkrx8Eov8Hm+GXDOa+EayqXCL0AAQ=; b=Sr+bhWD31w5SboF4ibZEYE9uouYsRxvQl7vjveNJldKVaaCq2Vvaei/l5c3DbEIrim fpBREqf0KiGH/F9aKw8Qqmiyn92bq4xsyKwk4IWIyw1b6mMIG85qJ7veH1IYuqpkuwV+ c88dVKt+zYKmlBq9yYJXMHE0Z6L60hKJIS9sFTZW0dZVVoMkTRISvSpWXZ/d71hNSom3 cJad8ploEnX6TrkgUqHB/PzL1Klbktn2JGdz8PwT6l9qNU5PZ1Z0ePF/JKMvc7NG+6qr RE332QHfVHJW5ROLwaVv1OINGVcdLvMuDiWgfSTpScdept4y9eKqC1CzwoUfmo4f5StE x+ug== 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 ca5si12073256pjb.1.2021.10.08.06.56.42; Fri, 08 Oct 2021 06:56:55 -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 S234113AbhJHN5E (ORCPT + 99 others); Fri, 8 Oct 2021 09:57:04 -0400 Received: from outbound-smtp11.blacknight.com ([46.22.139.106]:50881 "EHLO outbound-smtp11.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242324AbhJHN5B (ORCPT ); Fri, 8 Oct 2021 09:57:01 -0400 Received: from mail.blacknight.com (pemlinmail06.blacknight.ie [81.17.255.152]) by outbound-smtp11.blacknight.com (Postfix) with ESMTPS id 194D01C3E94 for ; Fri, 8 Oct 2021 14:55:05 +0100 (IST) Received: (qmail 8314 invoked from network); 8 Oct 2021 13:55:04 -0000 Received: from unknown (HELO stampy.112glenside.lan) (mgorman@techsingularity.net@[84.203.17.29]) by 81.17.254.9 with ESMTPA; 8 Oct 2021 13:55:04 -0000 From: Mel Gorman To: Linux-MM 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-fsdevel , LKML , Mel Gorman Subject: [PATCH 8/8] mm/vmscan: Delay waking of tasks throttled on NOPROGRESS Date: Fri, 8 Oct 2021 14:53:32 +0100 Message-Id: <20211008135332.19567-9-mgorman@techsingularity.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211008135332.19567-1-mgorman@techsingularity.net> References: <20211008135332.19567-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 --- mm/vmscan.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 7b54fec4072c..80a9a26f701f 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -3338,8 +3338,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