diff options
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r-- | mm/memcontrol.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 01c2d8f14685..78eb8552818b 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -314,14 +314,6 @@ static struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm) | |||
314 | return mem; | 314 | return mem; |
315 | } | 315 | } |
316 | 316 | ||
317 | static bool mem_cgroup_is_obsolete(struct mem_cgroup *mem) | ||
318 | { | ||
319 | if (!mem) | ||
320 | return true; | ||
321 | return css_is_removed(&mem->css); | ||
322 | } | ||
323 | |||
324 | |||
325 | /* | 317 | /* |
326 | * Call callback function against all cgroup under hierarchy tree. | 318 | * Call callback function against all cgroup under hierarchy tree. |
327 | */ | 319 | */ |
@@ -932,7 +924,7 @@ static int __mem_cgroup_try_charge(struct mm_struct *mm, | |||
932 | if (unlikely(!mem)) | 924 | if (unlikely(!mem)) |
933 | return 0; | 925 | return 0; |
934 | 926 | ||
935 | VM_BUG_ON(!mem || mem_cgroup_is_obsolete(mem)); | 927 | VM_BUG_ON(css_is_removed(&mem->css)); |
936 | 928 | ||
937 | while (1) { | 929 | while (1) { |
938 | int ret; | 930 | int ret; |
@@ -1488,8 +1480,9 @@ void mem_cgroup_uncharge_cache_page(struct page *page) | |||
1488 | __mem_cgroup_uncharge_common(page, MEM_CGROUP_CHARGE_TYPE_CACHE); | 1480 | __mem_cgroup_uncharge_common(page, MEM_CGROUP_CHARGE_TYPE_CACHE); |
1489 | } | 1481 | } |
1490 | 1482 | ||
1483 | #ifdef CONFIG_SWAP | ||
1491 | /* | 1484 | /* |
1492 | * called from __delete_from_swap_cache() and drop "page" account. | 1485 | * called after __delete_from_swap_cache() and drop "page" account. |
1493 | * memcg information is recorded to swap_cgroup of "ent" | 1486 | * memcg information is recorded to swap_cgroup of "ent" |
1494 | */ | 1487 | */ |
1495 | void mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent) | 1488 | void mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent) |
@@ -1506,6 +1499,7 @@ void mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent) | |||
1506 | if (memcg) | 1499 | if (memcg) |
1507 | css_put(&memcg->css); | 1500 | css_put(&memcg->css); |
1508 | } | 1501 | } |
1502 | #endif | ||
1509 | 1503 | ||
1510 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP | 1504 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP |
1511 | /* | 1505 | /* |