diff options
Diffstat (limited to 'mm/slub.c')
-rw-r--r-- | mm/slub.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1405,7 +1405,7 @@ static void __free_slab(struct kmem_cache *s, struct page *page) | |||
1405 | reset_page_mapcount(page); | 1405 | reset_page_mapcount(page); |
1406 | if (current->reclaim_state) | 1406 | if (current->reclaim_state) |
1407 | current->reclaim_state->reclaimed_slab += pages; | 1407 | current->reclaim_state->reclaimed_slab += pages; |
1408 | __free_pages(page, order); | 1408 | __free_memcg_kmem_pages(page, order); |
1409 | } | 1409 | } |
1410 | 1410 | ||
1411 | #define need_reserve_slab_rcu \ | 1411 | #define need_reserve_slab_rcu \ |
@@ -2323,6 +2323,7 @@ static __always_inline void *slab_alloc_node(struct kmem_cache *s, | |||
2323 | if (slab_pre_alloc_hook(s, gfpflags)) | 2323 | if (slab_pre_alloc_hook(s, gfpflags)) |
2324 | return NULL; | 2324 | return NULL; |
2325 | 2325 | ||
2326 | s = memcg_kmem_get_cache(s, gfpflags); | ||
2326 | redo: | 2327 | redo: |
2327 | 2328 | ||
2328 | /* | 2329 | /* |
@@ -3284,7 +3285,7 @@ static void *kmalloc_large_node(size_t size, gfp_t flags, int node) | |||
3284 | struct page *page; | 3285 | struct page *page; |
3285 | void *ptr = NULL; | 3286 | void *ptr = NULL; |
3286 | 3287 | ||
3287 | flags |= __GFP_COMP | __GFP_NOTRACK; | 3288 | flags |= __GFP_COMP | __GFP_NOTRACK | __GFP_KMEMCG; |
3288 | page = alloc_pages_node(node, flags, get_order(size)); | 3289 | page = alloc_pages_node(node, flags, get_order(size)); |
3289 | if (page) | 3290 | if (page) |
3290 | ptr = page_address(page); | 3291 | ptr = page_address(page); |
@@ -3390,7 +3391,7 @@ void kfree(const void *x) | |||
3390 | if (unlikely(!PageSlab(page))) { | 3391 | if (unlikely(!PageSlab(page))) { |
3391 | BUG_ON(!PageCompound(page)); | 3392 | BUG_ON(!PageCompound(page)); |
3392 | kmemleak_free(x); | 3393 | kmemleak_free(x); |
3393 | __free_pages(page, compound_order(page)); | 3394 | __free_memcg_kmem_pages(page, compound_order(page)); |
3394 | return; | 3395 | return; |
3395 | } | 3396 | } |
3396 | slab_free(page->slab_cache, page, object, _RET_IP_); | 3397 | slab_free(page->slab_cache, page, object, _RET_IP_); |