[Devel] [PATCH rh7 2/8] mm/mem_cgroup_iter: Always assign iter->last_visited under seqlock
Konstantin Khorenko
khorenko at virtuozzo.com
Sat Feb 20 12:24:08 MSK 2021
All other places (both read and assignment) are performed under
seqlock.
https://jira.sw.ru/browse/PSBM-123655
Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
mm/memcontrol.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 5be8fbfe0308..ba107b12f314 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1690,7 +1690,9 @@ struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup *root,
mz = mem_cgroup_zoneinfo(root, nid, zid);
iter = &mz->reclaim_iter[reclaim->priority];
if (prev && reclaim->generation != iter->generation) {
+ write_seqlock(&iter->last_visited_lock);
iter->last_visited = NULL;
+ write_sequnlock(&iter->last_visited_lock);
goto out_unlock;
}
--
2.24.3
More information about the Devel
mailing list