diff options
Diffstat (limited to 'features/rt/mm-memcontrol-Disable-preemption-in-__mod_memcg_lruv.patch')
-rw-r--r-- | features/rt/mm-memcontrol-Disable-preemption-in-__mod_memcg_lruv.patch | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/features/rt/mm-memcontrol-Disable-preemption-in-__mod_memcg_lruv.patch b/features/rt/mm-memcontrol-Disable-preemption-in-__mod_memcg_lruv.patch new file mode 100644 index 00000000..077738b2 --- /dev/null +++ b/features/rt/mm-memcontrol-Disable-preemption-in-__mod_memcg_lruv.patch @@ -0,0 +1,43 @@ +From 96e36ffab463f8f5823778279568a9cdd349c6c3 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +Date: Wed, 28 Oct 2020 18:15:32 +0100 +Subject: [PATCH 086/191] mm/memcontrol: Disable preemption in + __mod_memcg_lruvec_state() + +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> +--- + mm/memcontrol.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/mm/memcontrol.c b/mm/memcontrol.c +index e064ac0d850a..24091f7a64e2 100644 +--- a/mm/memcontrol.c ++++ b/mm/memcontrol.c +@@ -809,6 +809,7 @@ void __mod_memcg_lruvec_state(struct lruvec *lruvec, enum node_stat_item idx, + pn = container_of(lruvec, struct mem_cgroup_per_node, lruvec); + memcg = pn->memcg; + ++ preempt_disable_rt(); + /* Update memcg */ + __mod_memcg_state(memcg, idx, val); + +@@ -828,6 +829,7 @@ void __mod_memcg_lruvec_state(struct lruvec *lruvec, enum node_stat_item idx, + x = 0; + } + __this_cpu_write(pn->lruvec_stat_cpu->count[idx], x); ++ preempt_enable_rt(); + } + + /** +-- +2.19.1 + |