summaryrefslogtreecommitdiff
path: root/patches/mm-memcontrol-do_not_disable_irq.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/mm-memcontrol-do_not_disable_irq.patch')
-rw-r--r--patches/mm-memcontrol-do_not_disable_irq.patch38
1 files changed, 26 insertions, 12 deletions
diff --git a/patches/mm-memcontrol-do_not_disable_irq.patch b/patches/mm-memcontrol-do_not_disable_irq.patch
index cddbaeaf4ff6..da5c359b52c7 100644
--- a/patches/mm-memcontrol-do_not_disable_irq.patch
+++ b/patches/mm-memcontrol-do_not_disable_irq.patch
@@ -7,8 +7,8 @@ patch converts them local locks.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
- mm/memcontrol.c | 20 ++++++++++++++------
- 1 file changed, 14 insertions(+), 6 deletions(-)
+ mm/memcontrol.c | 24 ++++++++++++++++--------
+ 1 file changed, 16 insertions(+), 8 deletions(-)
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -29,7 +29,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/* Whether legacy memory+swap accounting is active */
static bool do_memsw_account(void)
{
-@@ -4535,12 +4538,12 @@ static int mem_cgroup_move_account(struc
+@@ -4574,12 +4577,12 @@ static int mem_cgroup_move_account(struc
ret = 0;
@@ -44,7 +44,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
out_unlock:
unlock_page(page);
out:
-@@ -5422,10 +5425,10 @@ void mem_cgroup_commit_charge(struct pag
+@@ -5486,10 +5489,10 @@ void mem_cgroup_commit_charge(struct pag
commit_charge(page, memcg, lrucare);
@@ -57,16 +57,17 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
if (do_memsw_account() && PageSwapCache(page)) {
swp_entry_t entry = { .val = page_private(page) };
-@@ -5481,14 +5484,14 @@ static void uncharge_batch(struct mem_cg
+@@ -5545,7 +5548,7 @@ static void uncharge_batch(struct mem_cg
memcg_oom_recover(memcg);
}
- local_irq_save(flags);
+ local_lock_irqsave(event_lock, flags);
- __this_cpu_sub(memcg->stat->count[MEM_CGROUP_STAT_RSS], nr_anon);
- __this_cpu_sub(memcg->stat->count[MEM_CGROUP_STAT_CACHE], nr_file);
- __this_cpu_sub(memcg->stat->count[MEM_CGROUP_STAT_RSS_HUGE], nr_huge);
- __this_cpu_add(memcg->stat->events[MEM_CGROUP_EVENTS_PGPGOUT], pgpgout);
+ __this_cpu_sub(memcg->stat->count[MEMCG_RSS], nr_anon);
+ __this_cpu_sub(memcg->stat->count[MEMCG_CACHE], nr_file);
+ __this_cpu_sub(memcg->stat->count[MEMCG_RSS_HUGE], nr_huge);
+@@ -5553,7 +5556,7 @@ static void uncharge_batch(struct mem_cg
+ __this_cpu_add(memcg->stat->events[PGPGOUT], pgpgout);
__this_cpu_add(memcg->stat->nr_page_events, nr_pages);
memcg_check_events(memcg, dummy_page);
- local_irq_restore(flags);
@@ -74,7 +75,20 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
if (!mem_cgroup_is_root(memcg))
css_put_many(&memcg->css, nr_pages);
-@@ -5838,6 +5841,7 @@ void mem_cgroup_swapout(struct page *pag
+@@ -5712,10 +5715,10 @@ void mem_cgroup_migrate(struct page *old
+
+ commit_charge(newpage, memcg, false);
+
+- local_irq_save(flags);
++ local_lock_irqsave(event_lock, flags);
+ mem_cgroup_charge_statistics(memcg, newpage, compound, nr_pages);
+ memcg_check_events(memcg, newpage);
+- local_irq_restore(flags);
++ local_unlock_irqrestore(event_lock, flags);
+ }
+
+ DEFINE_STATIC_KEY_FALSE(memcg_sockets_enabled_key);
+@@ -5907,6 +5910,7 @@ void mem_cgroup_swapout(struct page *pag
{
struct mem_cgroup *memcg, *swap_memcg;
unsigned short oldid;
@@ -82,7 +96,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
VM_BUG_ON_PAGE(PageLRU(page), page);
VM_BUG_ON_PAGE(page_count(page), page);
-@@ -5878,12 +5882,16 @@ void mem_cgroup_swapout(struct page *pag
+@@ -5947,12 +5951,16 @@ void mem_cgroup_swapout(struct page *pag
* important here to have the interrupts disabled because it is the
* only synchronisation we have for udpating the per-CPU variables.
*/
@@ -98,4 +112,4 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+ local_unlock_irqrestore(event_lock, flags);
}
- /*
+ /**