aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r--mm/memcontrol.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 556859fec4ef..228d6461c12a 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -776,7 +776,8 @@ static void memcg_check_events(struct mem_cgroup *memcg, struct page *page)
776 /* threshold event is triggered in finer grain than soft limit */ 776 /* threshold event is triggered in finer grain than soft limit */
777 if (unlikely(mem_cgroup_event_ratelimit(memcg, 777 if (unlikely(mem_cgroup_event_ratelimit(memcg,
778 MEM_CGROUP_TARGET_THRESH))) { 778 MEM_CGROUP_TARGET_THRESH))) {
779 bool do_softlimit, do_numainfo; 779 bool do_softlimit;
780 bool do_numainfo __maybe_unused;
780 781
781 do_softlimit = mem_cgroup_event_ratelimit(memcg, 782 do_softlimit = mem_cgroup_event_ratelimit(memcg,
782 MEM_CGROUP_TARGET_SOFTLIMIT); 783 MEM_CGROUP_TARGET_SOFTLIMIT);
@@ -4413,6 +4414,9 @@ static void mem_cgroup_usage_unregister_event(struct cgroup *cgrp,
4413 */ 4414 */
4414 BUG_ON(!thresholds); 4415 BUG_ON(!thresholds);
4415 4416
4417 if (!thresholds->primary)
4418 goto unlock;
4419
4416 usage = mem_cgroup_usage(memcg, type == _MEMSWAP); 4420 usage = mem_cgroup_usage(memcg, type == _MEMSWAP);
4417 4421
4418 /* Check if a threshold crossed before removing */ 4422 /* Check if a threshold crossed before removing */
@@ -4461,7 +4465,7 @@ swap_buffers:
4461 4465
4462 /* To be sure that nobody uses thresholds */ 4466 /* To be sure that nobody uses thresholds */
4463 synchronize_rcu(); 4467 synchronize_rcu();
4464 4468unlock:
4465 mutex_unlock(&memcg->thresholds_lock); 4469 mutex_unlock(&memcg->thresholds_lock);
4466} 4470}
4467 4471