From patchwork Tue Feb 11 06:19:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joonsoo Kim X-Patchwork-Id: 11374861 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CB457139A for ; Tue, 11 Feb 2020 06:20:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 93C3A20714 for ; Tue, 11 Feb 2020 06:20:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WhfqMBoT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 93C3A20714 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 8E9E26B0289; Tue, 11 Feb 2020 01:20:14 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 84A426B028A; Tue, 11 Feb 2020 01:20:14 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 75EBD6B028B; Tue, 11 Feb 2020 01:20:14 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0089.hostedemail.com [216.40.44.89]) by kanga.kvack.org (Postfix) with ESMTP id 5AF0C6B028A for ; Tue, 11 Feb 2020 01:20:14 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 16BAC1867 for ; Tue, 11 Feb 2020 06:20:14 +0000 (UTC) X-FDA: 76476846348.07.bird67_1fbe9a73204a X-Spam-Summary: 2,0,0,ec7cac039965ea19,d41d8cd98f00b204,js1304@gmail.com,:akpm@linux-foundation.org::linux-kernel@vger.kernel.org:hannes@cmpxchg.org:mhocko@kernel.org:hughd@google.com:minchan@kernel.org:vbabka@suse.cz:mgorman@techsingularity.net:kernel-team@lge.com:iamjoonsoo.kim@lge.com,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1345:1359:1437:1534:1541:1711:1730:1747:1777:1792:2198:2199:2393:2559:2562:2693:2731:2897:3138:3139:3140:3141:3142:3352:3865:3866:3867:3868:3870:3871:3872:3874:4250:5007:6261:6653:7576:7875:9010:9036:9413:10004:11026:11473:11658:11914:12296:12297:12517:12519:12555:12679:12895:13069:13141:13230:13311:13357:14096:14181:14384:14394:14721:21080:21444:21451:21627:21666:21740:30054:30069,0,RBL:209.85.214.196:@gmail.com:.lbl8.mailshell.net-62.50.0.100 66.100.201.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:30,LUA_SUMMARY:none X-HE-Tag: bird67_1fbe9a73204a X-Filterd-Recvd-Size: 4447 Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by imf06.hostedemail.com (Postfix) with ESMTP for ; Tue, 11 Feb 2020 06:20:13 +0000 (UTC) Received: by mail-pl1-f196.google.com with SMTP id p11so3827572plq.10 for ; Mon, 10 Feb 2020 22:20:13 -0800 (PST) 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=WhfqMBoTUlYB/HyZ+Nhd4PmIdY1pn2SPX1Gy0W/IKW80dzDui0tPjuRHOQ2DTIDRJZ 6aV4r1RABqEYQm7BtBQKNBGPEv4aprSda3V6UEjL12xo8MKxiJmPy13jsJ6OlJ7883Lf MjaaWe5zDuhyLjiaoKeZwNwJ4PHrVOzydaiXTIO39I+7URfHAj6u5C0BugnaNI8wr1k2 cc9K5AB1ZUNFxwdNjNcAGL9Nv2b3fRpJ6gaYa5SnkvhST34Ab0WgpbZuNkbAISP79r5k Z5Yp19ytLB3WxaEW8h3LL9bZwOXJKu51XJMzGxmwJYrJwB1t+pBztME4yeCU5uJr2R7o Kw1Q== 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=VpwE5aFKaWSEy6YXnAh+afNlQvmCqc9CDAJ/Kkcl2Utp6kBsKl6KfIHFa8FVXadTKh R70lbFE+iMrWvjeGkECFiW+dJqra+huD81Yu0ZrGU0D01H9+vh7K3vOUyDJNnx4xLCcn Ve+RG2DO/55gQWLBUkRPdpYcQ02ndISD3G5Dl/eizB+fN+dpi6IhxmsSDrqONcq3jfhS MNTIbW3lJaGJxwVMVwuJvV5v4gWaaGXwMcv/N1W8lbnbb98JpgaPwWaYUULfZaex+efj VWB0Prf2eRTU/Ak8t8XrzSlsXpWIxNq/5RRD0B0cN8YKlJx1SMyTlJKDiE49Nglc5MLr WJ1Q== X-Gm-Message-State: APjAAAUh2DdLlskOVJ8jCO1H2jSRmd/DGwkfL+20v0gPN5Lg2TmZReC5 tGrOp1RVhxnYaMem8VESp+c= X-Google-Smtp-Source: APXvYqzCG4W6Wny2VO03PW0GnJRMgu4X9J6iTBt5Ta02//1FH+AW5Tbp0YbAEhdgZcS8fiECwRR0Uw== X-Received: by 2002:a17:902:524:: with SMTP id 33mr17015509plf.241.1581402012575; Mon, 10 Feb 2020 22:20:12 -0800 (PST) Received: from localhost.localdomain ([114.206.198.176]) by smtp.gmail.com with ESMTPSA id x197sm2578696pfc.1.2020.02.10.22.20.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Feb 2020 22:20:12 -0800 (PST) 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 1/9] mm/vmscan: make active/inactive ratio as 1:1 for anon lru Date: Tue, 11 Feb 2020 15:19:45 +0900 Message-Id: <1581401993-20041-2-git-send-email-iamjoonsoo.kim@lge.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1581401993-20041-1-git-send-email-iamjoonsoo.kim@lge.com> References: <1581401993-20041-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;