Message ID | 20221206222315.37631-1-npache@redhat.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6FD7CC3A5A7 for <linux-mm@archiver.kernel.org>; Tue, 6 Dec 2022 22:23:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BC87F8E0003; Tue, 6 Dec 2022 17:23:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B78128E0001; Tue, 6 Dec 2022 17:23:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A70EB8E0003; Tue, 6 Dec 2022 17:23:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 982858E0001 for <linux-mm@kvack.org>; Tue, 6 Dec 2022 17:23:37 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 680E3C029A for <linux-mm@kvack.org>; Tue, 6 Dec 2022 22:23:37 +0000 (UTC) X-FDA: 80213309274.06.5722338 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf21.hostedemail.com (Postfix) with ESMTP id 180201C000D for <linux-mm@kvack.org>; Tue, 6 Dec 2022 22:23:35 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=iXpKdq+U; spf=pass (imf21.hostedemail.com: domain of npache@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=npache@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1670365416; a=rsa-sha256; cv=none; b=6yipTsFxinaw8kRWwMV+8GJPkqNrvSKZdYd5vtAF7kq7bu5Yq+Suwm/MZC1QFD1gP0rRxZ ylHehcdL5shKiDpAopri9Z9jDnd98I2BYC/3miItC+H4gM4x5mjgqfm+N6YYbsYD897bEr QgBOFkKhW62oS4cfHZcudmKp8sFuo/s= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=iXpKdq+U; spf=pass (imf21.hostedemail.com: domain of npache@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=npache@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1670365416; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=KbcWN/Q2/pafQvgYCQFGwmhf/LUYY3gpOtuCCKoJbLI=; b=GT9+6GLLmjm57mhC9+tJGrjYHE0iI8gC7pm0TcWt82NFQ163eZ6qIRhFDMZiyUcre8IMbm LZ/IUni1rv6SSL0RIya0/rKzscRTm/unmiruHFKrLWQWFaZ55Raq3VEPGvJFDPifEoO1za qe8nD3uRKu0pZ3qCzj36NJS/ukCjI1E= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670365415; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=KbcWN/Q2/pafQvgYCQFGwmhf/LUYY3gpOtuCCKoJbLI=; b=iXpKdq+U1apqFAVDymEFw8dqKVIH0srmusL9aNiKCqWJ4Dx54K7l9oRKIsp76CTk5gtmaW FAMNw8yVYJoZtXWVaX3ri//CSM369GWNJMZWKcXJFIuOyEgbty5YHG8PABvM1Xnd9t73b2 PfPlWimTnOtwFI2XYeXfxjHlN9NE+nA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-317-r1vEH37-OeiFQN_UhFKpZg-1; Tue, 06 Dec 2022 17:23:30 -0500 X-MC-Unique: r1vEH37-OeiFQN_UhFKpZg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8FDE3811E67; Tue, 6 Dec 2022 22:23:29 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.22.11.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id DA56E2027061; Tue, 6 Dec 2022 22:23:27 +0000 (UTC) From: Nico Pache <npache@redhat.com> To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: riel@surriel.com, mhocko@suse.com, shakeelb@google.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, hannes@cmpxchg.org, akpm@linux-foundation.org, aquini@redhat.com, longman@redhat.com Subject: [RFC] vmscan: Scale file_is_tiny calculation based on priority Date: Tue, 6 Dec 2022 15:23:15 -0700 Message-Id: <20221206222315.37631-1-npache@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Spamd-Result: default: False [3.30 / 9.00]; R_MISSING_CHARSET(2.50)[]; SUBJECT_HAS_UNDERSCORES(1.00)[]; MID_CONTAINS_FROM(1.00)[]; DMARC_POLICY_ALLOW(-0.50)[redhat.com,none]; BAYES_HAM(-0.30)[68.82%]; R_SPF_ALLOW(-0.20)[+ip4:170.10.129.0/24]; R_DKIM_ALLOW(-0.20)[redhat.com:s=mimecast20190719]; RCVD_NO_TLS_LAST(0.10)[]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_SEVEN(0.00)[11]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[redhat.com:+]; RCVD_COUNT_THREE(0.00)[4]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_NONE(0.00)[]; ARC_SIGNED(0.00)[hostedemail.com:s=arc-20220608:i=1]; ARC_NA(0.00)[] X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 180201C000D X-Stat-Signature: 6dqeg4kcooue79n5x1bsxyobfdwihgsg X-HE-Tag: 1670365415-398563 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
[RFC] vmscan: Scale file_is_tiny calculation based on priority
|
expand
|
diff --git a/mm/vmscan.c b/mm/vmscan.c index 026199c047e0..0d288bb5354e 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2882,7 +2882,7 @@ static void prepare_scan_count(pg_data_t *pgdat, struct scan_control *sc) anon = node_page_state(pgdat, NR_INACTIVE_ANON); sc->file_is_tiny = - file + free <= total_high_wmark && + file + free <= (total_high_wmark >> sc->priority) && !(sc->may_deactivate & DEACTIVATE_ANON) && anon >> sc->priority; }
Now that reclaiming anon memory is more prevelant (Johannes describes this well in commit f53af4285d77 ("mm: vmscan: fix extreme overreclaim and swap floods")), we've been seeing large bursts (sometimes in the order of multiple GiBs) of anon memory being reclaimed despite swappiness being very low (=1) and there being plenty of page cache remaining. Johannes commit f53af4285d77 ("mm: vmscan: fix extreme overreclaim and swap floods"), helped reduce these swap storms; however, it did not fully curb this effect. Under further investigation I noticed these swap storms correspond to the activation of file_is_tiny. file_is_tiny is being computed on a per-node basis, if reclaim drains the page cache on one node, and the scheduler is prefering new allocations on a separate node, file_is_tiny will remain elevated for a very long time, constantly draining anon from the node that is low on page cache. These burst of reclaim are also seen in the single node case, where once file_is_tiny=1, anon reclaim is too aggressive with a low swap value. Reduce these extreme bursts of anon reclaim by scaling the total_high_wmark down by the reclaim priority. This will activate file_is_tiny way less often, and for smaller bursts. Fixes: ccc5dc67340c ("mm/vmscan: make active/inactive ratio as 1:1 for anon lru") Fixes: 5df741963d52 ("mm: fix LRU balancing effect of new transparent huge pages") Signed-off-by: Nico Pache <npache@redhat.com> --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)