From: Vasily Averin <vvs@openvz.org>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Roman Gushchin <roman.gushchin@linux.dev>,
Vlastimil Babka <vbabka@suse.cz>,
Shakeel Butt <shakeelb@google.com>,
kernel@openvz.org, linux-kernel@vger.kernel.org,
Michal Hocko <mhocko@suse.com>,
cgroups@vger.kernel.org, netdev@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
Paolo Abeni <pabeni@redhat.com>
Subject: [PATCH net] net: enable memcg accounting for veth queues
Date: Fri, 29 Apr 2022 08:17:35 +0300 [thread overview]
Message-ID: <0b28d49b-605c-ac1a-df85-643164e69039@openvz.org> (raw)
In-Reply-To: <20220427095854.79554fab@kernel.org>
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>
---
drivers/net/veth.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index d29fb9759cc9..bd67f458641a 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -1310,7 +1310,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;
--
2.31.1
next prev parent reply other threads:[~2022-04-29 5:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-27 10:34 [PATCH] memcg: enable accounting for veth queues Vasily Averin
2022-04-27 16:58 ` Jakub Kicinski
2022-04-27 22:48 ` Vasily Averin
2022-04-29 5:17 ` Vasily Averin [this message]
2022-05-01 12:20 ` [PATCH net] net: enable memcg " patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0b28d49b-605c-ac1a-df85-643164e69039@openvz.org \
--to=vvs@openvz.org \
--cc=cgroups@vger.kernel.org \
--cc=davem@davemloft.net \
--cc=kernel@openvz.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhocko@suse.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=roman.gushchin@linux.dev \
--cc=shakeelb@google.com \
--cc=vbabka@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).