[Please do not top post] On Thu 22-11-18 10:19:58, 段熊春 wrote: > I had view the slab kmem_cache_alloc function,I think the virtual netdevice object will charged to memcg. > Becuse the function slab_pre_alloc_hook will choose a kmem_cache, which belong to current task memcg. Only for caches which opted in for kmem accounting SLAB_ACCOUNT or for allocations with __GFP_ACCOUNT. Is this the case for the virtual netdevice? I would check myself but I am not familiar with data structures in this area. > If virtual netdevice object not destroy by another command, the virtual netdevice object will still charged to memcg, and the memcg will still in memory. And that is why I've noted that charging objects which are not bound to a user context and/or generally reclaimable under memory pressure are not good candidates for kmem accounting. -- Michal Hocko SUSE Labs