summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/0332-mm-memcontrol-Disable-preemption-in-__mod_memcg_lruv.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches-rt/0332-mm-memcontrol-Disable-preemption-in-__mod_memcg_lruv.patch')
-rw-r--r--debian/patches-rt/0332-mm-memcontrol-Disable-preemption-in-__mod_memcg_lruv.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/debian/patches-rt/0332-mm-memcontrol-Disable-preemption-in-__mod_memcg_lruv.patch b/debian/patches-rt/0332-mm-memcontrol-Disable-preemption-in-__mod_memcg_lruv.patch
new file mode 100644
index 000000000..40b467019
--- /dev/null
+++ b/debian/patches-rt/0332-mm-memcontrol-Disable-preemption-in-__mod_memcg_lruv.patch
@@ -0,0 +1,46 @@
+From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Date: Wed, 28 Oct 2020 18:15:32 +0100
+Subject: [PATCH 332/342] mm/memcontrol: Disable preemption in
+ __mod_memcg_lruvec_state()
+Origin: https://git.kernel.org/cgit/linux/kernel/git/rt/linux-stable-rt.git/commit?id=63d8d55e818822e2fbbcc26d07e498d22d21f001
+
+[ Upstream commit 74858f0d38a8d3c069a0745ff53ae084c8e7cabb ]
+
+The callers expect disabled preemption/interrupts while invoking
+__mod_memcg_lruvec_state(). This works mainline because a lock of
+somekind is acquired.
+
+Use preempt_disable_rt() where per-CPU variables are accessed and a
+stable pointer is expected. This is also done in __mod_zone_page_state()
+for the same reason.
+
+Cc: stable-rt@vger.kernel.org
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Signed-off-by: Tom Zanussi <zanussi@kernel.org>
+
+ Conflicts:
+ mm/memcontrol.c
+---
+ include/linux/memcontrol.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
+index cc6b6532eb56..dbb2c4e27277 100644
+--- a/include/linux/memcontrol.h
++++ b/include/linux/memcontrol.h
+@@ -665,6 +665,7 @@ static inline void __mod_lruvec_state(struct lruvec *lruvec,
+
+ pn = container_of(lruvec, struct mem_cgroup_per_node, lruvec);
+
++ preempt_disable_rt();
+ /* Update memcg */
+ __mod_memcg_state(pn->memcg, idx, val);
+
+@@ -675,6 +676,7 @@ static inline void __mod_lruvec_state(struct lruvec *lruvec,
+ x = 0;
+ }
+ __this_cpu_write(pn->lruvec_stat_cpu->count[idx], x);
++ preempt_enable_rt();
+ }
+
+ static inline void mod_lruvec_state(struct lruvec *lruvec,