Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp226626ybt; Tue, 16 Jun 2020 22:28:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzWgqIty8R6ARn1FRsomtmATjRmidrMdjhz//oFEUsLYxQFGfMAerLQNzR2gyj4qtxyc2l X-Received: by 2002:aa7:c450:: with SMTP id n16mr5815622edr.6.1592371733621; Tue, 16 Jun 2020 22:28:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592371733; cv=none; d=google.com; s=arc-20160816; b=C24Da0Snmiwik7NV8g+LcMnxvjnLHe0DAEuzsVWXWt/4nBawzTCew1tm0rZefUuQ1W Iay9eTeyxL4bOQFynW2Dd0+FUib0CiHwVeTCAv1Q8qe4iTf1x84JfMW6uomAUpns0xkQ 0mDLXwjVqE3LpowrPBYHo8DQbpCvB4I77kGeAKFRZjzbWSk6gicZW3HI5Z10PMj2VWKd TFes61F3V/6qO2WEpAdlDViyp0FFbRiAunmcZmpWMqSJtnmWdMA4I2JgjsbLuhg9XxBo 85NEcKSAj5yDfucwuPAeVWLLfckW6kJKm2O8UpnmItus8q+t+XN7tWIBYySED73rdrc/ pLUA== 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=fNm3FGkY7NVgNGky8cgORMXuHncktdvkO+TFSQgkjpI=; b=Ypkvr/z+jw+q3z9lx44x+tV5ZCOunmCnVnvdMTojBsl2Y6lamSer1+6Q3fksOWZ0+M KsHFzrkrmzCFc85v4ueuEdDhfCIypZvna5JKdVQBWBTXtxD5ycu7xyeUHslejtBdAvEO ui8Bci/cIli4hOgakPYTcdAyc/YXUl4IMxOU0bEKric4IGun73hj9hlGlOn6dluTwHUN tR+Hr4QoZnzL61m21mdYuieITyjiMAvPbQe4bD/c5cGuyJufBRhwDGcBmyTN7ZCHWi7T gbJTWqOGCObPUw0TSGbxZ1QwZ+wIxxQsqUdhJa8JSJTWXXggU233RjZ2R+AkZgkwfUsT Qx3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DcY3ORY8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id q19si11525674edr.139.2020.06.16.22.28.29; Tue, 16 Jun 2020 22:28:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DcY3ORY8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726843AbgFQF0p (ORCPT + 99 others); Wed, 17 Jun 2020 01:26:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725851AbgFQF0n (ORCPT ); Wed, 17 Jun 2020 01:26:43 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D87AC061573 for ; Tue, 16 Jun 2020 22:26:43 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id h10so689958pgq.10 for ; Tue, 16 Jun 2020 22:26:43 -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=fNm3FGkY7NVgNGky8cgORMXuHncktdvkO+TFSQgkjpI=; b=DcY3ORY8xDdagE0AWcEaW+6hhR3H8CwMIoZyO+6Kk6Lc8LJrvv+GUHe0WVxyKRG0NI DvzZjBgyyqHQ2FEKaVHuW4mbYh2ZBesedtSubVk3wtmJTXTTf5o6gnDg/Lru3jz5Db/h SQfGsNHLBHQPEf+mN4iszszrtSYZRO5ZJEbTziTTpsJ6Fu53ZCyGWB+MoDwB7S4sHn2j Xozp4oqsXmfPUm+bUrpJCUPP+qcScSV2uhcKWSVmQDTtAB1JhEyAwAz8u1f9RMdT5KT7 yPeq+/v9TiqjSuMBk6SBq4pHnduqd+cNGW1Okc5N8odI6knZg/XE080ut7HNimq4lKN1 +iTw== 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=fNm3FGkY7NVgNGky8cgORMXuHncktdvkO+TFSQgkjpI=; b=En6aq/ZfHw/HxIT5EDszih1M5sRv2rZS/TntfM/DLRZxZJYPwUfcEacFvgI3d51q/3 CyMEfHDAJPi5n0ptrxIP4PTcFF9ez2p/ldFuUJa7WbNbxg9YUUE5d2vjsZJKvyZV6lqC HJBuIzhkXvmTSbll7NrM9Of9DoG8jCDd4ni2O7NtImAFLxb+RBwQ72WvCH2XrrPhaXDw NlFZ89RdmxyEqdYI3NqUS9qVueQ9qfUR6Xh3NVKsnId/IK+HP3RGGFp/pBzwbetiqMKE n9fnoMMWUj3b2XGEhZauWM6EuTWIYnO4PVBy5Mfv8hjGiVYHZlxDW+IU2BMBVb8K9H96 67gg== X-Gm-Message-State: AOAM533cLnDjWD2JIlwevP7h0QHgtNXMSPs8c1VzrxbKEaVeNVaiEtNf /VK2lk1e98D1DtUFLK0r6dA= X-Received: by 2002:a63:5b0e:: with SMTP id p14mr5059100pgb.43.1592371602744; Tue, 16 Jun 2020 22:26:42 -0700 (PDT) Received: from localhost.localdomain ([114.206.198.176]) by smtp.gmail.com with ESMTPSA id d184sm8830068pfd.85.2020.06.16.22.26.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jun 2020 22:26:42 -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 v6 1/6] mm/vmscan: make active/inactive ratio as 1:1 for anon lru Date: Wed, 17 Jun 2020 14:26:18 +0900 Message-Id: <1592371583-30672-2-git-send-email-iamjoonsoo.kim@lge.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1592371583-30672-1-git-send-email-iamjoonsoo.kim@lge.com> References: <1592371583-30672-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 749d239..9f940c4 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2212,7 +2212,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