All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Shi <shy828301@gmail.com>
To: mgorman@suse.de, kirill.shutemov@linux.intel.com, ziy@nvidia.com,
	mhocko@suse.com, ying.huang@intel.com, hughd@google.com,
	gerald.schaefer@linux.ibm.com, hca@linux.ibm.com,
	gor@linux.ibm.com, borntraeger@de.ibm.com,
	akpm@linux-foundation.org
Cc: shy828301@gmail.com, linux-mm@kvack.org,
	linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [v2 PATCH 4/7] mm: migrate: account THP NUMA migration counters correctly
Date: Tue, 13 Apr 2021 14:24:13 -0700	[thread overview]
Message-ID: <20210413212416.3273-5-shy828301@gmail.com> (raw)
In-Reply-To: <20210413212416.3273-1-shy828301@gmail.com>

Now both base page and THP NUMA migration is done via migrate_misplaced_page(),
keep the counters correctly for THP.

Signed-off-by: Yang Shi <shy828301@gmail.com>
---
 mm/migrate.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/mm/migrate.c b/mm/migrate.c
index 333448aa53f1..a473f25fbd01 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -2111,6 +2111,7 @@ int migrate_misplaced_page(struct page *page, struct vm_area_struct *vma,
 	LIST_HEAD(migratepages);
 	new_page_t *new;
 	bool compound;
+	unsigned int nr_pages = thp_nr_pages(page);
 
 	/*
 	 * PTE mapped THP or HugeTLB page can't reach here so the page could
@@ -2149,13 +2150,13 @@ int migrate_misplaced_page(struct page *page, struct vm_area_struct *vma,
 	if (nr_remaining) {
 		if (!list_empty(&migratepages)) {
 			list_del(&page->lru);
-			dec_node_page_state(page, NR_ISOLATED_ANON +
-					page_is_file_lru(page));
+			mod_node_page_state(page_pgdat(page), NR_ISOLATED_ANON +
+					page_is_file_lru(page), -nr_pages);
 			putback_lru_page(page);
 		}
 		isolated = 0;
 	} else
-		count_vm_numa_event(NUMA_PAGE_MIGRATE);
+		count_vm_numa_events(NUMA_PAGE_MIGRATE, nr_pages);
 	BUG_ON(!list_empty(&migratepages));
 	return isolated;
 
-- 
2.26.2


  parent reply	other threads:[~2021-04-13 21:24 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-13 21:24 [v2 RFC PATCH 0/7] mm: thp: use generic THP migration for NUMA hinting fault Yang Shi
2021-04-13 21:24 ` [v2 PATCH 1/7] mm: memory: add orig_pmd to struct vm_fault Yang Shi
2021-05-17 15:09   ` Mel Gorman
2021-05-17 19:39     ` Yang Shi
2021-05-17 19:39       ` Yang Shi
2021-05-18  7:36       ` Mel Gorman
2021-05-18 17:03         ` Yang Shi
2021-05-18 17:03           ` Yang Shi
2021-04-13 21:24 ` [v2 PATCH 2/7] mm: memory: make numa_migrate_prep() non-static Yang Shi
2021-05-17 15:11   ` Mel Gorman
2021-04-13 21:24 ` [v2 PATCH 3/7] mm: thp: refactor NUMA fault handling Yang Shi
2021-04-14  2:43   ` Huang, Ying
2021-04-14  2:43     ` Huang, Ying
2021-04-14 17:15     ` Yang Shi
2021-04-14 17:15       ` Yang Shi
2021-05-17 15:27   ` Mel Gorman
2021-05-17 19:41     ` Yang Shi
2021-05-17 19:41       ` Yang Shi
2021-04-13 21:24 ` Yang Shi [this message]
2021-05-17 15:28   ` [v2 PATCH 4/7] mm: migrate: account THP NUMA migration counters correctly Mel Gorman
2021-04-13 21:24 ` [v2 PATCH 5/7] mm: migrate: don't split THP for misplaced NUMA page Yang Shi
2021-05-17 15:29   ` Mel Gorman
2021-04-13 21:24 ` [v2 PATCH 6/7] mm: migrate: check mapcount for THP instead of ref count Yang Shi
2021-04-14  3:00   ` Huang, Ying
2021-04-14  3:00     ` Huang, Ying
2021-04-14 15:02     ` Zi Yan
2021-04-15  6:45       ` Huang, Ying
2021-04-15  6:45         ` Huang, Ying
2021-04-15 18:57         ` Zi Yan
2021-04-14 17:23     ` Yang Shi
2021-04-14 17:23       ` Yang Shi
2021-04-13 21:24 ` [v2 PATCH 7/7] mm: thp: skip make PMD PROT_NONE if THP migration is not supported Yang Shi
2021-05-17 15:30   ` Mel Gorman
2021-05-03 21:58 ` [v2 RFC PATCH 0/7] mm: thp: use generic THP migration for NUMA hinting fault Yang Shi
2021-05-03 21:58   ` Yang Shi

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=20210413212416.3273-5-shy828301@gmail.com \
    --to=shy828301@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=borntraeger@de.ibm.com \
    --cc=gerald.schaefer@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=hughd@google.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mhocko@suse.com \
    --cc=ying.huang@intel.com \
    --cc=ziy@nvidia.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.