aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slab.c
diff options
context:
space:
mode:
authorVladimir Davydov <vdavydov@parallels.com>2014-06-04 19:07:39 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-04 19:54:01 -0400
commitc67a8a685a6e9abbaf0235e084168f15a721ae39 (patch)
tree946c9890d1638aa5540b596beefc305ad5dc26d0 /mm/slab.c
parent1e32e77f95d60b121b6072e3e3a650a7f93068f9 (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/slab.c')
-rw-r--r--mm/slab.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/mm/slab.c b/mm/slab.c
index 7067ea7f3927..9ca3b87edabc 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -1712,7 +1712,6 @@ static struct page *kmem_getpages(struct kmem_cache *cachep, gfp_t flags,
1712 __SetPageSlab(page); 1712 __SetPageSlab(page);
1713 if (page->pfmemalloc) 1713 if (page->pfmemalloc)
1714 SetPageSlabPfmemalloc(page); 1714 SetPageSlabPfmemalloc(page);
1715 memcg_bind_pages(cachep, cachep->gfporder);
1716 1715
1717 if (kmemcheck_enabled && !(cachep->flags & SLAB_NOTRACK)) { 1716 if (kmemcheck_enabled && !(cachep->flags & SLAB_NOTRACK)) {
1718 kmemcheck_alloc_shadow(page, cachep->gfporder, flags, nodeid); 1717 kmemcheck_alloc_shadow(page, cachep->gfporder, flags, nodeid);
@@ -1748,7 +1747,6 @@ static void kmem_freepages(struct kmem_cache *cachep, struct page *page)
1748 page_mapcount_reset(page); 1747 page_mapcount_reset(page);
1749 page->mapping = NULL; 1748 page->mapping = NULL;
1750 1749
1751 memcg_release_pages(cachep, cachep->gfporder);
1752 if (current->reclaim_state) 1750 if (current->reclaim_state)
1753 current->reclaim_state->reclaimed_slab += nr_freed; 1751 current->reclaim_state->reclaimed_slab += nr_freed;
1754 __free_pages(page, cachep->gfporder); 1752 __free_pages(page, cachep->gfporder);