Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp3396312ybh; Mon, 16 Mar 2020 22:42:44 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuONso+Uo7hw17llD5dXKd503cfCDh9bEukW3a0GDIpLYbgFhSyOnsP1D9RvW1HQ7OKXP9z X-Received: by 2002:aca:c256:: with SMTP id s83mr2358573oif.57.1584423764786; Mon, 16 Mar 2020 22:42:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584423764; cv=none; d=google.com; s=arc-20160816; b=y5Or4fH3PufIatpzXcMZJJnV+njr69oOQMdvDJsxV4gMaOkrHhekWoFy0HfctG2tsY EAGKTQ5pkofNZ70mvN8FPRcOKCf3tlgk7r5rT0hqjY0nniJf/fQeL6DVnzcooaHSiKAA 62DlhBXqg5FXebAiv4n8rgH8qNlOv+0gwkyoqOvF/HC2Ho3YE2vnckqxHGvZetO6ec3i HdER6oKsw2XsIL3LzAv2WzMuwB4hTKxVaayrBgljm5gfpPSHT4JMLNALY28sa4ggl7qs MX9iWU/oqOlmFDvD/hISn62zH2idsobq/Ushc3ihVi2+vMITkwsiyusNySqtDll+JEFN TP8g== 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=PQRul9eP+ZS9HAAeaH8frtjB2cUDoTj2pwxbGJPwV4M=; b=yrK+aMDSuTn45nVncCUWkOi0z5CqvnntU1lJG9VQtTUCGycfXvSS+5nFoiPYJdJwSJ XTYwJLWFPvWW3SM4PIPYoRk2oI8h71LUB6ZxsCwEmAjM+dj0mmqbSIcoMikVMHl3lBl0 tY7iyp/Y1WzEOuI4XiP+LA77Q/WIcXS5U6D2uu0tFbtH9wG2Hb42JC2FlABbQB/MzR8Y /egmO33qLKuGObp0DX92a+HIl+af4QrkJcHFaWZar5dblBloBO2d2316+2FLvzI8P2dM lmLWjHtNdX++S8aiIxDQ990Cztv72PpBmMh8iQEpWJhSNK9Jt6Y/bhyvBkUjk7wa0XrB 5Sig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="Q/1WFbMu"; 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 u62si1226427oib.201.2020.03.16.22.42.33; Mon, 16 Mar 2020 22:42:44 -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="Q/1WFbMu"; 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 S1726272AbgCQFmL (ORCPT + 99 others); Tue, 17 Mar 2020 01:42:11 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:33448 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725468AbgCQFmK (ORCPT ); Tue, 17 Mar 2020 01:42:10 -0400 Received: by mail-pf1-f194.google.com with SMTP id n7so11320581pfn.0 for ; Mon, 16 Mar 2020 22:42: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=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=GXg/Z6wuWehoVaNJyXAhj1W5U7gKu2i14cPiL3v+/7Slmm0fJjfgH76rR6YZ8GdMt+ NwzvUpaiqFk2LzUUs3wR2a9x5r0mTh44oVNIO2oQPtqzluNBJXMnWY8q2+zTNbnDPP1x OHLelXHY/xOFwSo8Ngy9pxtEhTVHPXwtrwMkyxkS7mDKXG5rPM0T8LQUv4wMUlJHzuR7 nsJBOqHEYBsPgl0YjcskC2+yRHgSRVbCGrGnxtmy9o8qnJh7Uk44Z54t5q9GsBJ3iYrR +LYGnTB7u3+wcfjdkU8yE3XmrPKK7x5c4aM5p1vWuXLPQKHI45+tz/vAg+SiqEpdYOeJ 00OQ== X-Gm-Message-State: ANhLgQ2U2jhuke2erSRE9NWGbMGXTDKW7wcTTKuB8CvzVBEsW2r3VBb6 NgwyHQhn4rJhUZm6DYDNHVk= 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> 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. 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