[PATCH v2 4/5] mm/mglru: move iterate_mm_list_walk Helper

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

 



This helps to avoid building this code on powerpc.
No functional change in this patch.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@xxxxxxxxxxxxx>
---
 mm/vmscan.c | 54 ++++++++++++++++++++++++++---------------------------
 1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index a846a62df0ba..0ea7a07990d3 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -4356,6 +4356,33 @@ static void walk_mm(struct lruvec *lruvec, struct mm_struct *mm, struct lru_gen_
 	} while (err == -EAGAIN);
 }
 
+static bool iterate_mm_list_walk(struct lruvec *lruvec, unsigned long max_seq,
+				 bool can_swap, bool force_scan)
+{
+	bool success;
+	struct mm_struct *mm = NULL;
+	struct lru_gen_mm_walk *walk;
+
+	walk = set_mm_walk(NULL, true);
+	if (!walk) {
+		success = iterate_mm_list_nowalk(lruvec, max_seq);
+		return success;
+	}
+
+	walk->lruvec = lruvec;
+	walk->max_seq = max_seq;
+	walk->can_swap = can_swap;
+	walk->force_scan = force_scan;
+
+	do {
+		success = iterate_mm_list(lruvec, walk, &mm);
+		if (mm)
+			walk_mm(lruvec, mm, walk);
+	} while (mm);
+
+	return success;
+}
+
 static bool inc_min_seq(struct lruvec *lruvec, int type, bool can_swap)
 {
 	int zone;
@@ -4491,33 +4518,6 @@ static void inc_max_seq(struct lruvec *lruvec, bool can_swap, bool force_scan)
 	spin_unlock_irq(&lruvec->lru_lock);
 }
 
-static bool iterate_mm_list_walk(struct lruvec *lruvec, unsigned long max_seq,
-				 bool can_swap, bool force_scan)
-{
-	bool success;
-	struct mm_struct *mm = NULL;
-	struct lru_gen_mm_walk *walk;
-
-	walk = set_mm_walk(NULL, true);
-	if (!walk) {
-		success = iterate_mm_list_nowalk(lruvec, max_seq);
-		return success;
-	}
-
-	walk->lruvec = lruvec;
-	walk->max_seq = max_seq;
-	walk->can_swap = can_swap;
-	walk->force_scan = force_scan;
-
-	do {
-		success = iterate_mm_list(lruvec, walk, &mm);
-		if (mm)
-			walk_mm(lruvec, mm, walk);
-	} while (mm);
-
-	return success;
-}
-
 static bool try_to_inc_max_seq(struct lruvec *lruvec, unsigned long max_seq,
 			       struct scan_control *sc, bool can_swap, bool force_scan)
 {
-- 
2.41.0





[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