From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8F9FC2D0E8 for ; Fri, 3 Apr 2020 05:41:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 84B45206F5 for ; Fri, 3 Apr 2020 05:41:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YuVT/Cv0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 84B45206F5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 391B28E0009; Fri, 3 Apr 2020 01:41:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 369158E0007; Fri, 3 Apr 2020 01:41:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2805E8E0009; Fri, 3 Apr 2020 01:41:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0128.hostedemail.com [216.40.44.128]) by kanga.kvack.org (Postfix) with ESMTP id 0CA088E0007 for ; Fri, 3 Apr 2020 01:41:11 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id AFE4C181AEF15 for ; Fri, 3 Apr 2020 05:41:10 +0000 (UTC) X-FDA: 76665445500.27.army75_44740e1f6c317 X-HE-Tag: army75_44740e1f6c317 X-Filterd-Recvd-Size: 4500 Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Fri, 3 Apr 2020 05:41:10 +0000 (UTC) Received: by mail-pl1-f194.google.com with SMTP id s23so2264340plq.13 for ; Thu, 02 Apr 2020 22:41:10 -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=qYMZs47m+8gWgaDqwdx4pdiBlmBDdxwbxZiJCcPiP9WDIqjchD1cj1ZlmvFq8FPE6S h4mGLqn7DZwUGnfNzNqeEml4zSeCZYUDErEdQ5e8WEU/Wl27hgwjFneUUb5B7zdH6msh JmS1nUv1IpcEKvYNN242sxgpXlGU6HnxD7ltPlqnQUxM4dBM5ilQER6Qx1lHW1QrXTOT 0v15fnyY0oec27etZoqqQfII7ydVl50DKPEi75Y4+BDW2XeBQTTm1fh0O/zLl224RoPn gkxzP8wxOibbk6X5125+ayqBQclypHpcE0xIDbUgYuqOJQftCS7/EnQcJHi0L9XQ008d 7S6A== X-Gm-Message-State: AGi0Puavu5do7JMMy/TZw4Z4Fqdl6zc9R0hS2qmVpF5as0knn+zorN8i brBDbrIcB7eG+o5YpZpwxVU= X-Google-Smtp-Source: APiQypKu4S0SXkza4knI9dCJAIFznblWWNuSMFbeXe+h5rP/ezeeX2uovQ0G8Wi4uqZkIz4wmVk00A== 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> 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: 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