All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kirill Tkhai <ktkhai@virtuozzo.com>
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
Subject: [PATCH REBASED 2/4] mm: Move nr_deactivate accounting to shrink_active_list()
Date: Mon, 18 Mar 2019 12:28:05 +0300	[thread overview]
Message-ID: <155290128498.31489.18250485448913338607.stgit@localhost.localdomain> (raw)
In-Reply-To: <155290113594.31489.16711525148390601318.stgit@localhost.localdomain>

We know which LRU is not active.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Reviewed-by: Daniel Jordan <daniel.m.jordan@oracle.com>
---
 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);
 


  parent reply	other threads:[~2019-03-18  9:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-18  9:27 [PATCH REBASED 0/4] mm: Generalize putback functions Kirill Tkhai
2019-03-18  9:27 ` [PATCH REBASED 1/4] mm: Move recent_rotated pages calculation to shrink_inactive_list() Kirill Tkhai
2019-05-28 15:51   ` Johannes Weiner
2019-05-28 16:07     ` Kirill Tkhai
2019-03-18  9:28 ` Kirill Tkhai [this message]
2019-03-22 15:05   ` [PATCH] fixup: vmscan: Fix build on !CONFIG_MEMCG from nr_deactivate changes Chris Down
2019-03-22 15:06     ` Chris Down
2019-03-22 15:16     ` Kirill Tkhai
2019-03-18  9:28 ` [PATCH REBASED 3/4] mm: Remove pages_to_free argument of move_active_pages_to_lru() Kirill Tkhai
2019-03-18  9:28 ` [PATCH REBASED 4/4] mm: Generalize putback scan functions Kirill Tkhai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=155290128498.31489.18250485448913338607.stgit@localhost.localdomain \
    --to=ktkhai@virtuozzo.com \
    --cc=akpm@linux-foundation.org \
    --cc=daniel.m.jordan@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --subject='Re: [PATCH REBASED 2/4] mm: Move nr_deactivate accounting to shrink_active_list()' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.