]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mm/vmscan: make the annotations of refaults code at the right place
authorYang Yang <yang.yang29@zte.com.cn>
Sat, 13 Aug 2022 08:07:58 +0000 (08:07 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 17 Aug 2022 20:58:33 +0000 (13:58 -0700)
After patch "mm/workingset: prepare the workingset detection
infrastructure for anon LRU", we can handle the refaults of anonymous
pages too.  So the annotations of refaults should cover both of anonymous
pages and file pages.

Link: https://lkml.kernel.org/r/20220813080757.59131-1-yang.yang29@zte.com.cn
Fixes: 170b04b7ae4963 ("mm/workingset: prepare the workingset detection infrastructure for anon LRU")
Signed-off-by: Yang Yang <yang.yang29@zte.com.cn>
Signed-off-by: CGEL ZTE <cgel.zte@gmail.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/vmscan.c

index 06eeeae038dde54b8cb2ed722ad14145d7592cd5..b84cacc83a1e990c3e30e00312e6813d506f8fcd 100644 (file)
@@ -3226,6 +3226,11 @@ again:
        if (!sc->force_deactivate) {
                unsigned long refaults;
 
+               /*
+                * When refaults are being observed, it means a new
+                * workingset is being established. Deactivate to get
+                * rid of any stale active pages quickly.
+                */
                refaults = lruvec_page_state(target_lruvec,
                                WORKINGSET_ACTIVATE_ANON);
                if (refaults != target_lruvec->refaults[WORKINGSET_ANON] ||
@@ -3234,11 +3239,6 @@ again:
                else
                        sc->may_deactivate &= ~DEACTIVATE_ANON;
 
-               /*
-                * When refaults are being observed, it means a new
-                * workingset is being established. Deactivate to get
-                * rid of any stale active pages quickly.
-                */
                refaults = lruvec_page_state(target_lruvec,
                                WORKINGSET_ACTIVATE_FILE);
                if (refaults != target_lruvec->refaults[WORKINGSET_FILE] ||