Skip to content

Commit 8693eb4

Browse files
committed
Merge: [FJ10.0 Bug]: Demotion doesn't occurs when the DRAM is exhausted. [rhel-10.0]
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-10/-/merge_requests/321 JIRA: https://issues.redhat.com/browse/RHEL-71335 - mm/vmscan: accumulate nr_demoted for accurate demotion statistics (Herton R. Krzesinski) [[RHEL-71335](https://issues.redhat.com/browse/RHEL-71335)] - mm: vmscan : pgdemote vmstat is not getting updated when MGLRU is enabled. (Herton R. Krzesinski) [[RHEL-71335](https://issues.redhat.com/browse/RHEL-71335)] Signed-off-by: Herton R. Krzesinski <herton@redhat.com> Approved-by: Rafael Aquini <raquini@redhat.com> Approved-by: John W. Linville <linville@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Jan Stancek <jstancek@redhat.com>
2 parents d84b140 + 3c77eba commit 8693eb4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

mm/vmscan.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ static unsigned int shrink_folio_list(struct list_head *folio_list,
10531053
struct folio_batch free_folios;
10541054
LIST_HEAD(ret_folios);
10551055
LIST_HEAD(demote_folios);
1056-
unsigned int nr_reclaimed = 0;
1056+
unsigned int nr_reclaimed = 0, nr_demoted = 0;
10571057
unsigned int pgactivate = 0;
10581058
bool do_demote_pass;
10591059
struct swap_iocb *plug = NULL;
@@ -1522,8 +1522,9 @@ static unsigned int shrink_folio_list(struct list_head *folio_list,
15221522
/* 'folio_list' is always empty here */
15231523

15241524
/* Migrate folios selected for demotion */
1525-
stat->nr_demoted = demote_folio_list(&demote_folios, pgdat);
1526-
nr_reclaimed += stat->nr_demoted;
1525+
nr_demoted = demote_folio_list(&demote_folios, pgdat);
1526+
nr_reclaimed += nr_demoted;
1527+
stat->nr_demoted += nr_demoted;
15271528
/* Folios that could not be demoted are still in @demote_folios */
15281529
if (!list_empty(&demote_folios)) {
15291530
/* Folios which weren't demoted go back on @folio_list */
@@ -4637,6 +4638,9 @@ static int evict_folios(struct lruvec *lruvec, struct scan_control *sc, int swap
46374638
reset_batch_size(walk);
46384639
}
46394640

4641+
__mod_lruvec_state(lruvec, PGDEMOTE_KSWAPD + reclaimer_offset(),
4642+
stat.nr_demoted);
4643+
46404644
item = PGSTEAL_KSWAPD + reclaimer_offset();
46414645
if (!cgroup_reclaim(sc))
46424646
__count_vm_events(item, reclaimed);

0 commit comments

Comments
 (0)