aboutsummaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2015-01-28 17:14:16 +0100
committerAnders Roxell <anders.roxell@linaro.org>2015-05-08 22:30:56 +0200
commit59bef1f6ba568d290d41fae7e0118e0b5561c927 (patch)
treef5dd2e5de4e38e263ca8f22d7324941bfaabe64c /mm
parent058c62fd7caffe3951aa93bbb342462f5b285cb2 (diff)
mm/memcontrol: do no disable interrupts
There are a few local_irq_disable() which then take sleeping locks. This patch converts them local locks. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/memcontrol.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 8a41fb42413f..498e8844a142 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -60,6 +60,8 @@
#include <net/sock.h>
#include <net/ip.h>
#include <net/tcp_memcontrol.h>
+#include <linux/locallock.h>
+
#include "slab.h"
#include <asm/uaccess.h>
@@ -87,6 +89,7 @@ static int really_do_swap_account __initdata;
#define do_swap_account 0
#endif
+static DEFINE_LOCAL_IRQ_LOCK(event_lock);
static const char * const mem_cgroup_stat_names[] = {
"cache",
@@ -3419,12 +3422,12 @@ static int mem_cgroup_move_account(struct page *page,
move_unlock_mem_cgroup(from, &flags);
ret = 0;
- local_irq_disable();
+ local_lock_irq(event_lock);
mem_cgroup_charge_statistics(to, page, nr_pages);
memcg_check_events(to, page);
mem_cgroup_charge_statistics(from, page, -nr_pages);
memcg_check_events(from, page);
- local_irq_enable();
+ local_unlock_irq(event_lock);
out_unlock:
unlock_page(page);
out:
@@ -6406,10 +6409,10 @@ void mem_cgroup_commit_charge(struct page *page, struct mem_cgroup *memcg,
VM_BUG_ON_PAGE(!PageTransHuge(page), page);
}
- local_irq_disable();
+ local_lock_irq(event_lock);
mem_cgroup_charge_statistics(memcg, page, nr_pages);
memcg_check_events(memcg, page);
- local_irq_enable();
+ local_unlock_irq(event_lock);
if (do_swap_account && PageSwapCache(page)) {
swp_entry_t entry = { .val = page_private(page) };
@@ -6468,14 +6471,14 @@ static void uncharge_batch(struct mem_cgroup *memcg, unsigned long pgpgout,
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_add(memcg->stat->nr_page_events, nr_anon + nr_file);
memcg_check_events(memcg, dummy_page);
- local_irq_restore(flags);
+ local_unlock_irqrestore(event_lock, flags);
}
static void uncharge_list(struct list_head *page_list)