]> git.baikalelectronics.ru Git - kernel.git/commit
memcg: enable accounting for net_device and Tx/Rx queues
authorVasily Averin <vvs@virtuozzo.com>
Mon, 19 Jul 2021 10:44:23 +0000 (13:44 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Jul 2021 13:00:38 +0000 (06:00 -0700)
commite815e9d0840bc755d8db26e08e07c3d29cd36fd2
tree3740035e0684a32cfa86e1e41da7eca590284fa6
parent95cf91ee3e725b301e4f474c50365fdad658e2ed
memcg: enable accounting for net_device and Tx/Rx queues

Container netadmin can create a lot of fake net devices,
then create a new net namespace and repeat it again and again.
Net device can request the creation of up to 4096 tx and rx queues,
and force kernel to allocate up to several tens of megabytes memory
per net device.

It makes sense to account for them to restrict the host's memory
consumption from inside the memcg-limited container.

Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c