diff options
Diffstat (limited to 'patches/mm-memcontrol-Move-misplaced-local_unlock_irqrestore.patch')
-rw-r--r-- | patches/mm-memcontrol-Move-misplaced-local_unlock_irqrestore.patch | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/patches/mm-memcontrol-Move-misplaced-local_unlock_irqrestore.patch b/patches/mm-memcontrol-Move-misplaced-local_unlock_irqrestore.patch new file mode 100644 index 000000000000..06980cc36369 --- /dev/null +++ b/patches/mm-memcontrol-Move-misplaced-local_unlock_irqrestore.patch @@ -0,0 +1,31 @@ +From: Matt Fleming <matt@codeblueprint.co.uk> +Date: Sun, 26 Jan 2020 21:19:45 +0000 +Subject: [PATCH] mm/memcontrol: Move misplaced local_unlock_irqrestore() + +The comment about local_lock_irqsave() mentions just the counters and +css_put_many()'s callback just invokes a worker so it is safe to move the +unlock function after memcg_check_events() so css_put_many() can be invoked +without the lock acquired. + +Cc: Daniel Wagner <wagi@monom.org> +Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk> +[bigeasy: rewrote the patch description] +Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> +--- + mm/memcontrol.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/mm/memcontrol.c ++++ b/mm/memcontrol.c +@@ -7043,10 +7043,10 @@ void mem_cgroup_swapout(struct page *pag + mem_cgroup_charge_statistics(memcg, page, PageTransHuge(page), + -nr_entries); + memcg_check_events(memcg, page); ++ local_unlock_irqrestore(event_lock, flags); + + if (!mem_cgroup_is_root(memcg)) + css_put_many(&memcg->css, nr_entries); +- local_unlock_irqrestore(event_lock, flags); + } + + /** |