Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 260403
b: refs/heads/master
c: d1a05b6
h: refs/heads/master
i:
  260401: 9eedf37
  260399: 5086ca5
v: v3
  • Loading branch information
Michal Hocko authored and Linus Torvalds committed Jul 26, 2011
1 parent 3dfd6b0 commit 895b498
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 82f9d486e59f588c7d100865c36510644abda356
refs/heads/master: d1a05b6973c7cb33144fa965d73facc708ffc37d
13 changes: 7 additions & 6 deletions trunk/mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -2180,11 +2180,8 @@ static void drain_all_stock_async(struct mem_cgroup *root_mem)
struct memcg_stock_pcp *stock = &per_cpu(memcg_stock, cpu);
struct mem_cgroup *mem;

if (cpu == curcpu)
continue;

mem = stock->cached;
if (!mem)
if (!mem || !stock->nr_pages)
continue;
if (mem != root_mem) {
if (!root_mem->use_hierarchy)
Expand All @@ -2193,8 +2190,12 @@ static void drain_all_stock_async(struct mem_cgroup *root_mem)
if (!css_is_ancestor(&mem->css, &root_mem->css))
continue;
}
if (!test_and_set_bit(FLUSHING_CACHED_CHARGE, &stock->flags))
schedule_work_on(cpu, &stock->work);
if (!test_and_set_bit(FLUSHING_CACHED_CHARGE, &stock->flags)) {
if (cpu == curcpu)
drain_local_stock(&stock->work);
else
schedule_work_on(cpu, &stock->work);
}
}
put_online_cpus();
mutex_unlock(&percpu_charge_mutex);
Expand Down

0 comments on commit 895b498

Please sign in to comment.