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. 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. Above is just an example. The general scenario is as follows if a user process which has own memcg creates a semi-permeanent kernel object , and does not release this kernel object before exit. The memcg which belong to this process will just offline but not release until the semi-permeanent kernel object release. I think in those case, kernel will hold more memory than user’s think。no just sizeof(struct blabla),but sizeof(struct blabla) + memory memcg used.
|