Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp260536img; Mon, 18 Mar 2019 02:30:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpgzQT07LIRUti6FzFxluwqaAe704iO4wf4P8YfyqugcGSspe4SzuP0/6gQzlpLu5iN2U6 X-Received: by 2002:a62:458a:: with SMTP id n10mr18737715pfi.136.1552901400849; Mon, 18 Mar 2019 02:30:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552901400; cv=none; d=google.com; s=arc-20160816; b=wP2aR52zs8r2RjJ6f5D2XUPtPePaQrcQfzvEt624KnXht9QBYwJHoo0/JinmM8hXeM Y4DNLZTFfCZWeTug+0q1P4w7brdVeojcRwDbDddUCv9DoL1EoaRjLRhH2Aamc2fD26qf zgnT4XuXzsQ7AplbtiTOIDihMvJaDV20Urhe4BUQ8ogQToT+uTEFG9L86ZAUdRVqgdBp 8Y6ytFFKGbs1yPw9VuuBFMpQeXyrmQITJ9p/8kDtzljAS5fMQxKkY5+ZORCCueqhjjy3 pv5a/OqACODcJmu9RtB+yBL7k/8WJxH+2ElVGT/AWHRhotWUsT/IeWoh5ETjK+uLj2TB e2Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:to:from:subject; bh=ZQqLxxNSiNaN6i8+GsS7rp+8ipVxb8cl6tZ4lbzG+3o=; b=lHzxTzKYq7r5B40Fb+1H993cgt05qrIvTB4Y+aLpWdKS5pJmWO7Bv/gpsUlAdBAqLb R11UhE1yIjVvo29TtHTRb8reZLkbSkpk4TzRasgiy+Acdz5CxIhYmqBjf+kU0aEXIViG fm+5hTBAf0kG62lkfrs/QsIC0Gzsu5L5QXWMk9dagZiDiRcv5Yl2mORe+x+T7NvYKFQC 2q0GvEu1Ncck/kGzrHDuMfUKzptFg7iCog54RzViSB2uGfSik3C4ydOZkA6y2ooZs9D+ XRDQ+bHBCzCJuilO73rgmxxEWXNHEaXon03Amh8PKqqKpXQtkl7Q2hy+AEpyngEKICkS YCiA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p12si8666625plo.206.2019.03.18.02.29.45; Mon, 18 Mar 2019 02:30:00 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728026AbfCRJ2P (ORCPT + 99 others); Mon, 18 Mar 2019 05:28:15 -0400 Received: from relay.sw.ru ([185.231.240.75]:41434 "EHLO relay.sw.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728002AbfCRJ2H (ORCPT ); Mon, 18 Mar 2019 05:28:07 -0400 Received: from [172.16.25.169] (helo=localhost.localdomain) by relay.sw.ru with esmtp (Exim 4.91) (envelope-from ) id 1h5oYv-00055C-LZ; Mon, 18 Mar 2019 12:28:05 +0300 Subject: [PATCH REBASED 2/4] mm: Move nr_deactivate accounting to shrink_active_list() From: Kirill Tkhai To: akpm@linux-foundation.org, daniel.m.jordan@oracle.com, mhocko@suse.com, ktkhai@virtuozzo.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Date: Mon, 18 Mar 2019 12:28:05 +0300 Message-ID: <155290128498.31489.18250485448913338607.stgit@localhost.localdomain> In-Reply-To: <155290113594.31489.16711525148390601318.stgit@localhost.localdomain> References: <155290113594.31489.16711525148390601318.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We know which LRU is not active. Signed-off-by: Kirill Tkhai Reviewed-by: Daniel Jordan --- mm/vmscan.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index e610737b36df..d2adabe4457d 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2040,12 +2040,6 @@ static unsigned move_active_pages_to_lru(struct lruvec *lruvec, } } - if (!is_active_lru(lru)) { - __count_vm_events(PGDEACTIVATE, nr_moved); - count_memcg_events(lruvec_memcg(lruvec), PGDEACTIVATE, - nr_moved); - } - return nr_moved; } @@ -2137,6 +2131,10 @@ static void shrink_active_list(unsigned long nr_to_scan, nr_activate = move_active_pages_to_lru(lruvec, &l_active, &l_hold, lru); nr_deactivate = move_active_pages_to_lru(lruvec, &l_inactive, &l_hold, lru - LRU_ACTIVE); + + __count_vm_events(PGDEACTIVATE, nr_deactivate); + __count_memcg_events(lruvec_memcg(lruvec), PGDEACTIVATE, nr_deactivate); + __mod_node_page_state(pgdat, NR_ISOLATED_ANON + file, -nr_taken); spin_unlock_irq(&pgdat->lru_lock);