hi all:
In same case, I think it’s may be a problem。
if I create a virtual netdev device under mem cgroup(like ip link add ve_A type veth peer name ve_B).after that ,I destroy this mem cgroup。
I find that may the object net_device, will be hold by the kernel until I run command (ip link del ). And the memory pages which container the object won’t be uncharge. mem_cgroup object also will be not free.
Anothers may think kernel just hold sizeof(struct netdev_device) memory size. But,it’s not really,it’s much bigger than they think.
It’s maybe a problems, I am not very sure about that.
Thanks
Thanks for replying, Michal.
cc to duanxiongchun
At 2018-11-21 17:10:41, "Michal Hocko" <mhocko@kernel.org> wrote:
>On Wed 21-11-18 16:46:48, dong wrote:
>> The last question: If I alloc many small pages and not free them, will
>> I exhaust the memory ( because every page contains `mem_cgroup` )?
>
>No, the memory will get reclaimed on the memory pressure or for
>anonymous one (malloc) when the process allocating it terminates,
>--
>Michal Hocko
>SUSE Labs