From patchwork Thu Feb 20 05:11: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: 11393337 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 35B07109A for ; Thu, 20 Feb 2020 05:12:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 009242468B for ; Thu, 20 Feb 2020 05:12:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="vS9cyEBo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 009242468B 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 AD07C6B0008; Thu, 20 Feb 2020 00:12:07 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A81E46B000A; Thu, 20 Feb 2020 00:12:07 -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 8F97F6B000C; Thu, 20 Feb 2020 00:12:07 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0137.hostedemail.com [216.40.44.137]) by kanga.kvack.org (Postfix) with ESMTP id 7A1456B0008 for ; Thu, 20 Feb 2020 00:12:07 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 5C59E2C14 for ; Thu, 20 Feb 2020 05:12:07 +0000 (UTC) X-FDA: 76509333894.18.lip26_4cb0ad3bc4c38 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.216.66:@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:24,LUA_SUMMARY:none X-HE-Tag: lip26_4cb0ad3bc4c38 X-Filterd-Recvd-Size: 4445 Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Thu, 20 Feb 2020 05:12:06 +0000 (UTC) Received: by mail-pj1-f66.google.com with SMTP id q39so372932pjc.0 for ; Wed, 19 Feb 2020 21:12:06 -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=vS9cyEBoFKHWrvPtC8OZbasab9nwtANJEc2h/q7eGSEO/A8dvE/mTKAkuqj+zTDTN9 Cs4cLsQXcT04UMBCZrQjxhWzMjMgLJAss8G6lFcYlAnbenm2uW9xuU4Zrs0m9q0lVgCh uUzoiVJtFMuXMRp8tD1xeFozEpo5KxFkB4eUTnbv+y3eds/b0NarnANwBnxovD0eUl8s uMWSBE+u0QJChZ/sjKvRpPk7fAd0mc3yGnRE5sxkZnj9kIf4jR+V8OBTQwng2gebMrO6 HTWN10EWR1icagTx793SLimADUlVsZireXGhMXKp1RkZ9IdZ4aTf/2G/ZY7iJhtnKCiC E7WQ== 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=ADMJm8XlY1/ymFjqH36rXYyADoUy6gmY2UmJp2FVIresCrmoqHWsUlveXm4otkcKe0 Io8ex3L/sJB2bon8DPW2EB9s85UG+rKBTpSs1yYrs+uFDxYl4kQ41y7BPIDpAGOHoTnd 2ebXif3O9mvE4uxwrNPrx6lhmRwTmESsVCsRsOjHwc0ul2+9wtFNc1SGKx6A72K9kvSv 08R8cRV5Gp35ME9ENog4MUnX72s0DGg5YIhOT09laz6Xpjo7qh39DeMVERgrHSi9nW/U +auQJA0QAaw4fi90gB8NOqw1k6VmhWPB/0tME87zW/PATJ4sK/M62f+jQdDkIG4mzQ80 OfCA== X-Gm-Message-State: APjAAAWK8yEzfY87hgYcDvNht3Ybc2yD9cL25tj2p4qsy5qON017sTgQ Rg/U1+OjyASR8wAFOjor0H8= X-Google-Smtp-Source: APXvYqwlItaUvBIwBji0ySYidzcULBRhxfBK5nO3HiwVvqD6yf5AqAnxqkgIZL+joHyMTp8fVbDC2w== X-Received: by 2002:a17:90a:234f:: with SMTP id f73mr1457975pje.109.1582175525753; Wed, 19 Feb 2020 21:12:05 -0800 (PST) Received: from localhost.localdomain ([114.206.198.176]) by smtp.gmail.com with ESMTPSA id t15sm1472599pgr.60.2020.02.19.21.12.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Feb 2020 21:12:05 -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 v2 1/9] mm/vmscan: make active/inactive ratio as 1:1 for anon lru Date: Thu, 20 Feb 2020 14:11:45 +0900 Message-Id: <1582175513-22601-2-git-send-email-iamjoonsoo.kim@lge.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1582175513-22601-1-git-send-email-iamjoonsoo.kim@lge.com> References: <1582175513-22601-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 Reviewed-by: Johannes Weiner --- 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;