Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3367414ybb; Sun, 22 Mar 2020 22:53:10 -0700 (PDT) X-Google-Smtp-Source: ADFU+vsbfjxAT/aDn2TAwtRgpTllWmZEYm2ndxM/+fdZpSzfxD7h6H97mdNc/jWTOskc/An3eI9a X-Received: by 2002:a9d:6b02:: with SMTP id g2mr1220858otp.340.1584942790440; Sun, 22 Mar 2020 22:53:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584942790; cv=none; d=google.com; s=arc-20160816; b=XDfEE9xu2Iiu65pqTgFkob4HTcrh55JoLHNMkopgsA/oCSBc48KZgLINYyRj4qM7WM lOQLL8DDz69RuwDyCMHLd7+56/c6pO6uardGWwu2uC9eCOftFj3AnS1lX0vAr3+ejn85 emf1FdwkRbNKA1GezjUP1NV8IwQg8sPxjwDkZvsx49lCnC6b8ov+nWojyTPXWKLKyKwj EvlaRTUayZj5NMLghN30N18lazthfp0NJJ5/dSep1SuYZTn7fhzr6OWHfYxHJOoUIfCP 5g+TDiU+PDvRpLpkTn6FVvS9nVHKQhcqaTxc+BCuAUXCWW6G0Vmye58nD1GrXmTJLz4I 0xLw== 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=U7jG+Redj2n/Yx20QRQJyqa8ihVuhx36qawgSQPthFA=; b=EqvA3n03byREuuPtPhSw/dR5rdfXZzbPkc7T8vJEAk5cJHhSnvUsgZX9zJTsAbaLV3 raDpJ/oUzy+iUKC+Mzy5+w9eDw/ovxepRhGJDMTp5TT/u7+poW9bdqYm1qlx2N90Yyun 02y8ucMWrSd+NwfX3gmt1M2tLl0ydOfsVQujj+H2q8mVeivOJ1xro5hzzNF8FvyDcmwJ 1DbiT5vJRIO/BGkOlZmbViMDU10KcqY/NLEaHCqVd+hlx+FOMQnP29wLRb1W74hQZ2J2 H7LIz8JtNXbQb5MW12O9ayQ/CxC8texbOXcLTNZN6uWNRscQf9dZqENHYHQhQqChyI45 SHEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=sT2oaupD; 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 s84si6494730oib.83.2020.03.22.22.52.55; Sun, 22 Mar 2020 22:53:10 -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=sT2oaupD; 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 S1727178AbgCWFwd (ORCPT + 99 others); Mon, 23 Mar 2020 01:52:33 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:36699 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725930AbgCWFwd (ORCPT ); Mon, 23 Mar 2020 01:52:33 -0400 Received: by mail-pg1-f195.google.com with SMTP id z72so6658465pgz.3 for ; Sun, 22 Mar 2020 22:52:32 -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=U7jG+Redj2n/Yx20QRQJyqa8ihVuhx36qawgSQPthFA=; b=sT2oaupDw/Yl/87fmDzroo8tDxr2qptcfNoatb3rT/4/Upulp99BL6swyzEqXhNEM6 poIZbN0EMmY2lPh1NM+GeaLO3kXQGAsAmM1wAYlCuKBRXGpOzfgRbhCBilZhoKgZljzD XjGqt0A/fAixNeIFKqooAkjFaHtI9MA0MEqW6OK8nkGC/zRDCV6A2eXbwDqQz4IIO8OP gXRZFTp4w9Qel84PdQHiVKH8oGwOLTneeTMyhKk4WlJbMU9u/ne+7oaRheHxgdEFv1uk FGEWI4kIoGp9A1Ozz4qQd2tR3qjjvhlJ7b2WHDg6+7y9w4VDLKAUxpDUNYZs0f7RzeRP oWRQ== 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=U7jG+Redj2n/Yx20QRQJyqa8ihVuhx36qawgSQPthFA=; b=dXCiyheubh5NNYh9y9mW3uEUogFk5KuFaF0Uh4V3HxkrbgtaeyYpf8FsJum4BZr2mX uYCGLlPV9axyZuHYF7Cxw46PVtS37UR3lhGfQ7zYnxMfvGkmlnJG833TvCY5n4ljicnu M8i3VvlJKlvMa+gTWF4lYAyq+86Z3YquEWRewWAbD3Wxi0p2EfNiaSi4f1PgUuL/xpnE 9qQhU+v7EcDjj2Y8kexhL1F6lOt8TGCKD0dL+B5Snz3PNPorb5jUupxNt92Ho7nuaMqo mJZCWJ8HhsDkqJEXN+sDL+A9VIRQGksz/Dj8Wqid2fkx0wkCr84GwfguXbLuWjpD8G+Y GHkw== X-Gm-Message-State: ANhLgQ0XV6HkHTW4dB+rwkpMf2YV8OTVpukmO205BjI6YkCHwiW6dJys DOsN4RSh/Ze4eRBC4USR0JU= X-Received: by 2002:a63:1404:: with SMTP id u4mr20171266pgl.172.1584942751981; Sun, 22 Mar 2020 22:52:31 -0700 (PDT) Received: from localhost.localdomain ([114.206.198.176]) by smtp.gmail.com with ESMTPSA id y30sm12563058pff.67.2020.03.22.22.52.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 22 Mar 2020 22:52:31 -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 v4 1/8] mm/vmscan: make active/inactive ratio as 1:1 for anon lru Date: Mon, 23 Mar 2020 14:52:05 +0900 Message-Id: <1584942732-2184-2-git-send-email-iamjoonsoo.kim@lge.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1584942732-2184-1-git-send-email-iamjoonsoo.kim@lge.com> References: <1584942732-2184-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. Acked-by: Johannes Weiner 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