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.8 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,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 C1510C2BB1D for ; Tue, 17 Mar 2020 05:42:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7BC69206EC for ; Tue, 17 Mar 2020 05:42:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Q/1WFbMu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7BC69206EC 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 2CE726B0006; Tue, 17 Mar 2020 01:42:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 27FD86B0007; Tue, 17 Mar 2020 01:42:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 16F876B0008; Tue, 17 Mar 2020 01:42:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0203.hostedemail.com [216.40.44.203]) by kanga.kvack.org (Postfix) with ESMTP id F32CF6B0006 for ; Tue, 17 Mar 2020 01:42:10 -0400 (EDT) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id CD67C180AD815 for ; Tue, 17 Mar 2020 05:42:10 +0000 (UTC) X-FDA: 76603758420.03.burst25_6a4ccc27c9106 X-HE-Tag: burst25_6a4ccc27c9106 X-Filterd-Recvd-Size: 4444 Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Tue, 17 Mar 2020 05:42:10 +0000 (UTC) Received: by mail-pf1-f194.google.com with SMTP id l184so11295022pfl.7 for ; Mon, 16 Mar 2020 22:42: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=PQRul9eP+ZS9HAAeaH8frtjB2cUDoTj2pwxbGJPwV4M=; b=Q/1WFbMu/icSL+Ap36D0aa4UwgXfof+yGn1T1JqL8WsyjwNH6Zzd2UBVYMloA4Q+ZV glzBsUXTo15Euf11RWj1HwtZrdjEaNjs/FGMUP5AI+DsnY57IpuSgVMS00Ch8JS2Avuf 2+imd/BJK+NzoZXRZDY9osKyxFsfQWUV7N1KWA+aulkEbJpibZdPxOxB5cIgmkrqS9WT pQSC8Up0a5Gdwy+ybnyFYN7FFOSQJtxxInTBGv6cGgfGKq6mm8JiL/getIboxAs+KYer hbp5+MPJ9ZMF957nRbMOiJ7ZqgocMgDW1RDP4rSosZ6x2hUMk66DpY6yq/EOLh6hC2oP 0BtQ== 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=PQRul9eP+ZS9HAAeaH8frtjB2cUDoTj2pwxbGJPwV4M=; b=L9yb1qABsl1LcVrLwQ4aa7k0N4mCnf94hc/kA3r7OC6kByIvP/stn0Kl5kvmjil5Ih WIb9cqVEIsr1MMtgoLWlOqm9a5v91mmcbCNzCPy4Htx1Y0wCxQ3MXVeJBWrgOoCXC+pU Un0lNSsBiSrkeSQfMc2RgH0qrwnjtLrxTGombJnmilbBFqNzdBKrl7RXJLiksHjG9dR7 u2SUvjTINA/11fdt3rqDRBqNIwNH+JWXRmhcCLcLZLOW1PzZP/1zXrkyvgGhVDyjjho8 EoAXFqOGbo7/KF33mjw4orYPgl1eL0lPD95QsUJeChLfW6aoejeLsHg/or2csxPOOyDR l8yw== X-Gm-Message-State: ANhLgQ1K+kUCgKmBL/GSfoFFtSLtefdvc2MwEFG2t6HAcJwJdG0+nf94 NTOVW4RFmlgCxcqURUGa8Eo= X-Google-Smtp-Source: ADFU+vv0q7qpwhdkztwUEw/q6jy7XGPGBI2IJSRInrYuXm82iDmLLWAgyZ1n8qeW2bNLeok+KptNOw== X-Received: by 2002:aa7:96f8:: with SMTP id i24mr3344885pfq.321.1584423729232; Mon, 16 Mar 2020 22:42:09 -0700 (PDT) Received: from localhost.localdomain ([114.206.198.176]) by smtp.gmail.com with ESMTPSA id i21sm1141757pgn.5.2020.03.16.22.42.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 16 Mar 2020 22:42: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 v3 1/9] mm/vmscan: make active/inactive ratio as 1:1 for anon lru Date: Tue, 17 Mar 2020 14:41:49 +0900 Message-Id: <1584423717-3440-2-git-send-email-iamjoonsoo.kim@lge.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1584423717-3440-1-git-send-email-iamjoonsoo.kim@lge.com> References: <1584423717-3440-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. 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 572fb17..e772f3f 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2217,7 +2217,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