Skip to content

Commit 727bab3

Browse files
ryncsn1Naim
authored andcommitted
mm/mglru: rename variables related to aging and rotation
The current variable name isn't helpful. Make the variable names more meaningful. Only naming change, no behavior change. Suggested-by: Barry Song <baohua@kernel.org> Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com> Reviewed-by: Chen Ridong <chenridong@huaweicloud.com> Reviewed-by: Barry Song <baohua@kernel.org> Signed-off-by: Kairui Song <kasong@tencent.com> Reviewed-by: Axel Rasmussen <axelrasmussen@google.com>
1 parent 23791b0 commit 727bab3

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

mm/vmscan.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4802,15 +4802,15 @@ static bool should_run_aging(struct lruvec *lruvec, unsigned long max_seq,
48024802
*/
48034803
static long get_nr_to_scan(struct lruvec *lruvec, struct scan_control *sc, int swappiness)
48044804
{
4805-
bool success;
4805+
bool need_aging;
48064806
unsigned long nr_to_scan;
48074807
struct mem_cgroup *memcg = lruvec_memcg(lruvec);
48084808
DEFINE_MAX_SEQ(lruvec);
48094809

48104810
if (mem_cgroup_below_min(sc->target_mem_cgroup, memcg))
48114811
return -1;
48124812

4813-
success = should_run_aging(lruvec, max_seq, swappiness, &nr_to_scan);
4813+
need_aging = should_run_aging(lruvec, max_seq, swappiness, &nr_to_scan);
48144814

48154815
/* try to scrape all its memory if this memcg was deleted */
48164816
if (nr_to_scan && !mem_cgroup_online(memcg))
@@ -4819,7 +4819,7 @@ static long get_nr_to_scan(struct lruvec *lruvec, struct scan_control *sc, int s
48194819
nr_to_scan = apply_proportional_protection(memcg, sc, nr_to_scan);
48204820

48214821
/* try to get away with not aging at the default priority */
4822-
if (!success || sc->priority == DEF_PRIORITY)
4822+
if (!need_aging || sc->priority == DEF_PRIORITY)
48234823
return nr_to_scan >> sc->priority;
48244824

48254825
/* stop scanning this lruvec as it's low on cold folios */
@@ -4912,7 +4912,7 @@ static bool try_to_shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc)
49124912

49134913
static int shrink_one(struct lruvec *lruvec, struct scan_control *sc)
49144914
{
4915-
bool success;
4915+
bool need_rotate;
49164916
unsigned long scanned = sc->nr_scanned;
49174917
unsigned long reclaimed = sc->nr_reclaimed;
49184918
struct mem_cgroup *memcg = lruvec_memcg(lruvec);
@@ -4930,7 +4930,7 @@ static int shrink_one(struct lruvec *lruvec, struct scan_control *sc)
49304930
memcg_memory_event(memcg, MEMCG_LOW);
49314931
}
49324932

4933-
success = try_to_shrink_lruvec(lruvec, sc);
4933+
need_rotate = try_to_shrink_lruvec(lruvec, sc);
49344934

49354935
shrink_slab(sc->gfp_mask, pgdat->node_id, memcg, sc->priority);
49364936

@@ -4940,10 +4940,10 @@ static int shrink_one(struct lruvec *lruvec, struct scan_control *sc)
49404940

49414941
flush_reclaim_state(sc);
49424942

4943-
if (success && mem_cgroup_online(memcg))
4943+
if (need_rotate && mem_cgroup_online(memcg))
49444944
return MEMCG_LRU_YOUNG;
49454945

4946-
if (!success && lruvec_is_sizable(lruvec, sc))
4946+
if (!need_rotate && lruvec_is_sizable(lruvec, sc))
49474947
return 0;
49484948

49494949
/* one retry if offlined or too small */

0 commit comments

Comments
 (0)