diff options
author | Vladimir Davydov <vdavydov@parallels.com> | 2014-06-04 19:07:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-04 19:54:01 -0400 |
commit | c67a8a685a6e9abbaf0235e084168f15a721ae39 (patch) | |
tree | 946c9890d1638aa5540b596beefc305ad5dc26d0 /mm/slub.c | |
parent | 1e32e77f95d60b121b6072e3e3a650a7f93068f9 (diff) |
memcg, slab: merge memcg_{bind,release}_pages to memcg_{un}charge_slab
Currently we have two pairs of kmemcg-related functions that are called on
slab alloc/free. The first is memcg_{bind,release}_pages that count the
total number of pages allocated on a kmem cache. The second is
memcg_{un}charge_slab that {un}charge slab pages to kmemcg resource
counter. Let's just merge them to keep the code clean.
Signed-off-by: Vladimir Davydov <vdavydov@parallels.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Glauber Costa <glommer@gmail.com>
Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/slub.c')
-rw-r--r-- | mm/slub.c | 2 |
1 files changed, 0 insertions, 2 deletions
@@ -1422,7 +1422,6 @@ static struct page *new_slab(struct kmem_cache *s, gfp_t flags, int node) | |||
1422 | 1422 | ||
1423 | order = compound_order(page); | 1423 | order = compound_order(page); |
1424 | inc_slabs_node(s, page_to_nid(page), page->objects); | 1424 | inc_slabs_node(s, page_to_nid(page), page->objects); |
1425 | memcg_bind_pages(s, order); | ||
1426 | page->slab_cache = s; | 1425 | page->slab_cache = s; |
1427 | __SetPageSlab(page); | 1426 | __SetPageSlab(page); |
1428 | if (page->pfmemalloc) | 1427 | if (page->pfmemalloc) |
@@ -1473,7 +1472,6 @@ static void __free_slab(struct kmem_cache *s, struct page *page) | |||
1473 | __ClearPageSlabPfmemalloc(page); | 1472 | __ClearPageSlabPfmemalloc(page); |
1474 | __ClearPageSlab(page); | 1473 | __ClearPageSlab(page); |
1475 | 1474 | ||
1476 | memcg_release_pages(s, order); | ||
1477 | page_mapcount_reset(page); | 1475 | page_mapcount_reset(page); |
1478 | if (current->reclaim_state) | 1476 | if (current->reclaim_state) |
1479 | current->reclaim_state->reclaimed_slab += pages; | 1477 | current->reclaim_state->reclaimed_slab += pages; |