]> git.baikalelectronics.ru Git - kernel.git/commit
net: Make account struct net to memcg
authorKirill Tkhai <ktkhai@virtuozzo.com>
Thu, 1 Mar 2018 12:23:28 +0000 (15:23 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 7 Mar 2018 15:19:10 +0000 (10:19 -0500)
commit8b9b22c17a90849da1e42fa1a4c0b6b73fe444f9
treecbac1df04ca36f33c22cc6db718ff35732863b40
parentf1b6be6c326b1aede691471f5b5ecedf9861e5f5
net: Make account struct net to memcg

The patch adds SLAB_ACCOUNT to flags of net_cachep cache,
which enables accounting of struct net memory to memcg kmem.
Since number of net_namespaces may be significant, user
want to know, how much there were consumed, and control.

Note, that we do not account net_generic to the same memcg,
where net was accounted, moreover, we don't do this at all (*).
We do not want the situation, when single memcg memory deficit
prevents us to register new pernet_operations.

(*)Even despite there is !current process accounting already
available in linux-next. See kmalloc_memcg() there for the details.

Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/net_namespace.c