mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
mm: memcontrol: account slab stats per lruvec
Josef's redesign of the balancing between slab caches and the page cache requires slab cache statistics at the lruvec level. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Johannes Weiner <[email protected]> Acked-by: Vladimir Davydov <[email protected]> Cc: Josef Bacik <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Rik van Riel <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
00f3ca2c2d
commit
7779f21236
3 changed files with 7 additions and 27 deletions
18
mm/slab.h
18
mm/slab.h
|
|
@ -274,22 +274,11 @@ static __always_inline int memcg_charge_slab(struct page *page,
|
|||
gfp_t gfp, int order,
|
||||
struct kmem_cache *s)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (!memcg_kmem_enabled())
|
||||
return 0;
|
||||
if (is_root_cache(s))
|
||||
return 0;
|
||||
|
||||
ret = memcg_kmem_charge_memcg(page, gfp, order, s->memcg_params.memcg);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
mod_memcg_page_state(page,
|
||||
(s->flags & SLAB_RECLAIM_ACCOUNT) ?
|
||||
NR_SLAB_RECLAIMABLE : NR_SLAB_UNRECLAIMABLE,
|
||||
1 << order);
|
||||
return 0;
|
||||
return memcg_kmem_charge_memcg(page, gfp, order, s->memcg_params.memcg);
|
||||
}
|
||||
|
||||
static __always_inline void memcg_uncharge_slab(struct page *page, int order,
|
||||
|
|
@ -297,11 +286,6 @@ static __always_inline void memcg_uncharge_slab(struct page *page, int order,
|
|||
{
|
||||
if (!memcg_kmem_enabled())
|
||||
return;
|
||||
|
||||
mod_memcg_page_state(page,
|
||||
(s->flags & SLAB_RECLAIM_ACCOUNT) ?
|
||||
NR_SLAB_RECLAIMABLE : NR_SLAB_UNRECLAIMABLE,
|
||||
-(1 << order));
|
||||
memcg_kmem_uncharge(page, order);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue