diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 1cd944c2a734..a96d9015ff73 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -6396,14 +6396,14 @@ enum mem_cgroup_protection mem_cgroup_protected(struct mem_cgroup *root, parent_usage = page_counter_read(&parent->memory); - memcg->memory.emin = effective_protection(usage, parent_usage, + WRITE_ONCE(memcg->memory.emin, effective_protection(usage, parent_usage, READ_ONCE(memcg->memory.min), READ_ONCE(parent->memory.emin), - atomic_long_read(&parent->memory.children_min_usage)); + atomic_long_read(&parent->memory.children_min_usage))); - memcg->memory.elow = effective_protection(usage, parent_usage, + WRITE_ONCE(memcg->memory.elow, effective_protection(usage, parent_usage, memcg->memory.low, READ_ONCE(parent->memory.elow), - atomic_long_read(&parent->memory.children_low_usage)); + atomic_long_read(&parent->memory.children_low_usage))); out: if (usage <= memcg->memory.emin)