]> git.hungrycats.org Git - linux/commitdiff
net: enable memcg accounting for veth queues
authorVasily Averin <vvs@openvz.org>
Fri, 29 Apr 2022 05:17:35 +0000 (08:17 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Mar 2024 14:38:45 +0000 (14:38 +0000)
[ Upstream commit 961c6136359eef38a8c023d02028fdcd123f02a6 ]

veth netdevice defines own rx queues and allocates array containing
up to 4095 ~750-bytes-long 'struct veth_rq' elements. Such allocation
is quite huge and should be accounted to memcg.

Signed-off-by: Vasily Averin <vvs@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stable-dep-of: 1ce7d306ea63 ("veth: try harder when allocating queue memory")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/veth.c

index 85c3e12f83627c54a3eec8919c2aecb24275f7a6..87cee614618ca165f9a34ac3d90b173d25e28a31 100644 (file)
@@ -1303,7 +1303,7 @@ static int veth_alloc_queues(struct net_device *dev)
        struct veth_priv *priv = netdev_priv(dev);
        int i;
 
-       priv->rq = kcalloc(dev->num_rx_queues, sizeof(*priv->rq), GFP_KERNEL);
+       priv->rq = kcalloc(dev->num_rx_queues, sizeof(*priv->rq), GFP_KERNEL_ACCOUNT);
        if (!priv->rq)
                return -ENOMEM;