Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp122196ybb; Thu, 2 Apr 2020 22:41:46 -0700 (PDT) X-Google-Smtp-Source: APiQypLiWac3v3yVhsN7nUkv+hB7E9WWdJqTV5Hj+d7VtIHyFJA+uWabKxh2RGpdluJr20dBS0Bx X-Received: by 2002:aca:b5c3:: with SMTP id e186mr1796390oif.114.1585892506579; Thu, 02 Apr 2020 22:41:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585892506; cv=none; d=google.com; s=arc-20160816; b=mTFi9VNQDjpv0ZFlW75ruxmkmdYVPvoXHVKG0u3Mxf3Ybk0qO+cK+91Uoia5pBK+8H p0e6mVd66Ay/CMD5E2mrFvLVx2039VEHzDPx/+7fgdeN/sjENVkvgpgwrjyQsTORw2g7 5NAAWh1Bj0jBTi4sNzpXhKjbPwLAc7zHodChT+fNCltYQ/pUTFLdVb+eMQ22fA+kesfz zcxYybVSE3+H24TFHmWKE8fY7+HjpCw8yoUEBFfxSIXfy5CLeFX2CObOfilhWGpkPx7T QD2DjTdnIH3ETKTwP36nngdC9OD6riy7qclTSCI8fHfcInU/ruBQ/fw9/Oywi+V53jQP /qGA== 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; bh=RN7gf2lJmmbJD4X7vNri1vuhOhZQZ58Qtkt4COVm3Rs=; b=N6G1wt0auw1uNo7IKlQx5mCHI9MPpviTjCdXnVYYjrsJoJmkZAoPObBJabCv6sfFJk YmzD9gxTfxeEzhnFoyT0+VOaNY6fP4nzJcTBz8SzBb/ocigfYD+ezb8NC1VA8oAqCA1x 3t7BpiJMvJA3Q1HQWN6VSJPuUPEU49Nz84cRf7h4XIH0fYzdZp9RZSbmWepVA3aSmuaa 5GNrwaQaYpoMxtY4D626RIcNTXqUzN0lBvoD7a+E1h89EyuiJPD7xxt8kk0pT8AJOAI5 XPmgm0UahJ6ArRqAQkvS+TbutXK/vvrApl5PMu0P4Rb5mciidRRgfV1/gSPeiwlzc2NT XUsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="YuVT/Cv0"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w203si3202263oie.193.2020.04.02.22.41.34; Thu, 02 Apr 2020 22:41:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@gmail.com header.s=20161025 header.b="YuVT/Cv0"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732784AbgDCFlK (ORCPT + 99 others); Fri, 3 Apr 2020 01:41:10 -0400 Received: from mail-pj1-f65.google.com ([209.85.216.65]:50562 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729349AbgDCFlK (ORCPT ); Fri, 3 Apr 2020 01:41:10 -0400 Received: by mail-pj1-f65.google.com with SMTP id v13so2534431pjb.0 for ; Thu, 02 Apr 2020 22:41:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RN7gf2lJmmbJD4X7vNri1vuhOhZQZ58Qtkt4COVm3Rs=; b=YuVT/Cv0HYSJnHhFYVelRiT86tny4w371FRXqoNWOXB0iMTdgj+ns+a9yzlxmlE3kE 3a/QCiJBNed5RxrsEICzQ3lLaUd5bw0JuPV5AhSvnZuEkzZHC3L94ssgRaiQPtOxCf4o mlvTc4W2kCFD6ARGbn+USh46tZpvCQRwKQWozo80EN78lhqXexyCe3azXxCF4aRjKq9Z Bv4ftgqvn1HkkBqnrqpeW3+T04vaufXtJc0IVZQKvjjezcFLX/QbwTL2EGh2VhS+i4Gy dsUDDRqQv22qgUjk7+9Ln9w7aQFFIsC2Dh9ZI0Cnk9FtsErwSDgNMsmwNAT1kMvDm3Mc vmVA== 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=RN7gf2lJmmbJD4X7vNri1vuhOhZQZ58Qtkt4COVm3Rs=; b=jfaGLqe1ow3+LRFBcJcveGAMl1imThh6sSO5PJ78SSyDUG6fZfazTH16hRJ9iK2hK7 L6jtsd2g1maQ/zK0YmzsxGG91pai8jdh2fpWw2hzs7SGdZg5Cr4l7D8yAIISoXGucT1j 4EeZ/nuZvmaLDMZT/GSK6qIXPmFdNIYpnNhUfTSHeh7jZlpMCbnYCt9D/JdErbiZTgtX Al4SqSSCH58V3Yq1Ub69N3WVlUlI7zG69gPK5LvCP0B4KFonDhJ8f9WwCSqUOkb+/2gf r1e3dAdR4kpYNBkel9biQmATCSaKeiF5a33N8XgaCSWNaRhrJIBndeyrM+5YkVPqltti GdfA== X-Gm-Message-State: AGi0Pubo1OkqG3PG95spKhW5r3bBxblryQ55llqjDP+1ijTu6r/67dH/ CLpiAm2H5+DMPZ6qwd4/M/w= X-Received: by 2002:a17:90b:19cf:: with SMTP id nm15mr7739445pjb.68.1585892469005; Thu, 02 Apr 2020 22:41:09 -0700 (PDT) Received: from localhost.localdomain ([114.206.198.176]) by smtp.gmail.com with ESMTPSA id e6sm4568295pgu.44.2020.04.02.22.41.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 02 Apr 2020 22:41:08 -0700 (PDT) From: js1304@gmail.com X-Google-Original-From: iamjoonsoo.kim@lge.com To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Johannes Weiner , Michal Hocko , Hugh Dickins , Minchan Kim , Vlastimil Babka , Mel Gorman , kernel-team@lge.com, Joonsoo Kim Subject: [PATCH v5 01/10] mm/vmscan: make active/inactive ratio as 1:1 for anon lru Date: Fri, 3 Apr 2020 14:40:39 +0900 Message-Id: <1585892447-32059-2-git-send-email-iamjoonsoo.kim@lge.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1585892447-32059-1-git-send-email-iamjoonsoo.kim@lge.com> References: <1585892447-32059-1-git-send-email-iamjoonsoo.kim@lge.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joonsoo Kim Current implementation of LRU management for anonymous page has some problems. Most important one is that it doesn't protect the workingset, that is, pages on the active LRU list. Although, this problem will be fixed in the following patchset, the preparation is required and this patch does it. What following patchset does is to restore workingset protection. In this case, newly created or swap-in pages are started their lifetime on the inactive list. If inactive list is too small, there is not enough chance to be referenced and the page cannot become the workingset. In order to provide enough chance to the newly anonymous pages, this patch makes active/inactive LRU ratio as 1:1. Acked-by: Johannes Weiner Signed-off-by: Joonsoo Kim --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 8763705..df92119 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2203,7 +2203,7 @@ static bool inactive_is_low(struct lruvec *lruvec, enum lru_list inactive_lru) active = lruvec_page_state(lruvec, NR_LRU_BASE + active_lru); gb = (inactive + active) >> (30 - PAGE_SHIFT); - if (gb) + if (gb && is_file_lru(inactive_lru)) inactive_ratio = int_sqrt(10 * gb); else inactive_ratio = 1; -- 2.7.4