Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp269751ybv; Wed, 19 Feb 2020 21:13:27 -0800 (PST) X-Google-Smtp-Source: APXvYqzQQYbfpZACg/CZ5JEkcIBS/L9LxaTV0c5mKJKO4jS5wxd2Ew7bEWeZoSdcaNUJ2rpA6t73 X-Received: by 2002:a9d:5a09:: with SMTP id v9mr21263722oth.214.1582175607016; Wed, 19 Feb 2020 21:13:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582175607; cv=none; d=google.com; s=arc-20160816; b=Oyegn8+EDEs7NRI57ogi8uWzRRD5nOgzionyaCk8vtxRtxkWyV9edOf6rk6pAStjZP oK528lH5FEMr9YMJ9SkvcE51wcfxTD8y5/VZCvKmPlFDUhZBOA0pN6rqOlS/VgxZnZMR OVoRP0Cmay92F/BSY1l+0C1eZzv46iKB9FOWCdPj4t8VpeJTkysjWMKbZnl5nDvtXunj snUdAABMFzq9BKBiyxlpuQEWW9SLznw+hBM3ukmHEMhZTUHNcpUeLFCxZFhteEIsm4xP Ri2NISCxKWxFma7N9GRZNbHPJ1AKxyZdheaVdVNjaHea957PPi0jY4Z+gCVMTgneM5yN Q69A== 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=XEDLSo4Lyp4Nr4bbkZ+AJAOYotUGEUhHle3f01+4RH9ziq8q234besH1Oun0M31mWY jmi540gmAqQkjZvN9EKTTfG1G+we8hhAfICuJ30xqUHlhTP5uIe2tsRWlm9O16vwHo/V VZ3fYnw7StzjPSt3V7EwxJntQMCrfhQtvrEb+V9sB0Q9MnQnTVftJKwpO7g0FueueX2m NC/vC0GXjslV1juJccxS56bKWQEg3xyJH7F4/Cb+S1wtT73LP2Uokml5+NCfoQUGF7Mj cx81UYfCIxPE8j/k0fPQrGJkm4nr3SGO94KlBY1vRVkDxm/8+5czMN84u9ua4qaBf4nw jwxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vS9cyEBo; 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 v7si10740878oic.208.2020.02.19.21.13.14; Wed, 19 Feb 2020 21:13:27 -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=vS9cyEBo; 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 S1726472AbgBTFMH (ORCPT + 99 others); Thu, 20 Feb 2020 00:12:07 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:38826 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725811AbgBTFMG (ORCPT ); Thu, 20 Feb 2020 00:12:06 -0500 Received: by mail-pl1-f193.google.com with SMTP id t6so1063535plj.5 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=OdpIgZa55zUVHazD/0ZUorlmvcSboeUKE86m3j3YF9k2ba1yPNvScb784N0XSmCKiY aXMzlkBi2Gf5F4co8WPhSNondzH3+ZQLi5qRQVcIEBynw2ooffiFwpJKYfkaCMyS93/m Bs1BvUDxSXS+tyMwjDXmKTFPl0B97kCdKzsGtwbbNmoU74WuG/5UlSiQvg2hQwU9UW71 Tww8lkOwwM9GwtWW0K2Unv77e5GIYZqnX4Q5Od5OfFFF2gUI4bZ7PO/6yat03e2nv3u7 NYEaRH43RE2NzvQHULV9D6LmBzuEqFVuu9t2+KOEbeAj65CYq+XqEhGLmP63CUqtIK8B KFAQ== X-Gm-Message-State: APjAAAXR6Yqip6SM+Do2n19Eus7gVXWT0j/3TS20Yji9s01jQbgCLKhA 1DXkH12cqaKKoZcBy7S4HHs= 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> 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