Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4600395ybv; Mon, 10 Feb 2020 23:25:21 -0800 (PST) X-Google-Smtp-Source: APXvYqzi4tbp0tZbzxre0MIFn7ZaDyDthitQ6UDec31Jx75ebW+NDd5mzE3zqLv4BZA5AIbZzlJS X-Received: by 2002:a9d:7d9a:: with SMTP id j26mr3973406otn.21.1581405921157; Mon, 10 Feb 2020 23:25:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581405921; cv=none; d=google.com; s=arc-20160816; b=iLE5//Y8UYAlC+9rPVtVHYPOX/kL7XeNNJElX+Uf2ERe7U8I2wTCRT5kjUVFdGG2NQ R1PRwRhVGlE8LaFAjW8E6H/Bn1DpfnVsSq/jWVCvK+swzH3az4UVSGb/GAIwdqN4pLDs se5OLCmEQJlbzlTBqsrWByxGZDy9Gg48uE+MpAUEom19WBe8l35p6YsgTS+j1hx/pwE1 W6S2u1SIcv6YjdKLlCHP/gkk1dJhu2+jVokwVABOab3W+1KkfFvz9VC28oa47Hr5jtMS NrCH6yaB6bYQ/EGlZvt0Lgyct++LfcmAI9UJ/+hd5lLdaVDkWvQLYtq6nfSBLgfFMMck +olQ== 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=m0KHTMVe6U+35SOLE9W+v5xwlqM0ZX76hqXtHkv8ncvSC7MUzzks4Gc9rrKSS/1/OF YndW7AC89vbPes9pxrtfNuTa3lBJ0Yz+zlSgRSaQJXdcu90IIVPF78MEzLuMimCT5VHP pEI1VwRJRvI1ls76IoqGw0mLlvoeg11/MtsPc1+vEeQsUYvRA+fictMZN4uU2aRoEzH0 N/8M6ElJR8U8y4kSJYPg35hEml9cAhoHdpEGYhQwiBtQo0/2TEVp0Ce3Pr/drSSMr9Y6 4ASoXT6XQSwpEY/+yM0Tvb1JiVu9kY2mxBkHm5evOd1ihlUKb1kjCX6/KudkJGHEDnWa M6HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WhfqMBoT; 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 y186si1452139oig.241.2020.02.10.23.24.36; Mon, 10 Feb 2020 23:25:21 -0800 (PST) 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=WhfqMBoT; 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 S1728197AbgBKGUN (ORCPT + 99 others); Tue, 11 Feb 2020 01:20:13 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:42172 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727953AbgBKGUN (ORCPT ); Tue, 11 Feb 2020 01:20:13 -0500 Received: by mail-pl1-f196.google.com with SMTP id e8so3828904plt.9 for ; Mon, 10 Feb 2020 22:20:12 -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=OrR8TIx7i09mFWrbNWC66D4Rd3L8o3mE3UUdaUsna7VbPvo78e/b27aFFShpaYpr/X kjzbc5OdU8E/X+h/ZaAx92BrpueZ+m/cDnEd4dxPVcB2/OjZKSrwsyDjYpQzCScFivjg I9oUZLopVYTDEmIj4yE9Jss0eOjf5q6lcMSYjCNzEsT6nx+oCCeGde0Bm6CRjgJ3nUPk zgHVtz6cLc/kYm4WTilYFrj9ha8hXfKnF8KjfWB5K8DucC+ph0c25f7UwoWVZKvkalMz JXDTzUIZ99064QnTck/hforSuijp++ZEakx/SvnmyaxvEbicbqKmwZYm6hCGTDe18f6y /JfQ== X-Gm-Message-State: APjAAAWUXsS8inYbSLkSYRH5jQ6/OuYkxkRWZAg52diXgaKW9s2MDYwF RTJQ2uQWQDJdlPNwbo5C6AU= 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> 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