[PATCH 3/3] mm/vmscan: not use NUMA_NO_NODE as indicator of page on different node

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Now we are sure there is at lease one page on page_list, so it is safe
to get the nid of it. This means it is not necessary to use NUMA_NO_NODE
as an indicator for the beginning of iteration or a page on different
node.

Signed-off-by: Wei Yang <richard.weiyang@xxxxxxxxx>
---
 mm/vmscan.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 3a36ebd6295d..f9998cba236f 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2519,7 +2519,7 @@ static void shrink_active_list(unsigned long nr_to_scan,
 
 unsigned long reclaim_pages(struct list_head *page_list)
 {
-	int nid = NUMA_NO_NODE;
+	int nid;
 	unsigned int nr_reclaimed = 0;
 	LIST_HEAD(node_page_list);
 	struct reclaim_stat dummy_stat;
@@ -2538,11 +2538,9 @@ unsigned long reclaim_pages(struct list_head *page_list)
 
 	noreclaim_flag = memalloc_noreclaim_save();
 
+	nid = page_to_nid(lru_to_page(page_list));
 	do {
 		page = lru_to_page(page_list);
-		if (nid == NUMA_NO_NODE) {
-			nid = page_to_nid(page);
-		}
 
 		if (nid == page_to_nid(page)) {
 			ClearPageActive(page);
@@ -2559,7 +2557,7 @@ unsigned long reclaim_pages(struct list_head *page_list)
 			putback_lru_page(page);
 		}
 
-		nid = NUMA_NO_NODE;
+		nid = page_to_nid(lru_to_page(page_list));
 	} while (!list_empty(page_list));
 
 	nr_reclaimed += shrink_page_list(&node_page_list,
-- 
2.33.1





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux