Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp240120iob; Mon, 2 May 2022 18:12:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCph1iDEsdL8114Sa93nEwGADJynBwXLN2c1bBLaGXD8QB29E/wEzDH5F5CtPrWyK586mQ X-Received: by 2002:a17:90a:9294:b0:1b9:48e9:a030 with SMTP id n20-20020a17090a929400b001b948e9a030mr2091938pjo.200.1651540335204; Mon, 02 May 2022 18:12:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651540335; cv=none; d=google.com; s=arc-20160816; b=q9bslwb0TeNZgZZpWn93lfSehws+WCJnqnKTTkt+07kbSFTsoQKGWYxCrPaTJzjZbm At6MxEThXjdqOkT9T1UYNnwA/jwHkQo23/9RRgGRhmT0JCX8Ga6F95G3N01Ver9g2a5b AMRNqwf2583+FcxPmGGZU3HdKJflAatGwG0lWOvT1t7StqCha3kCHs4tfDoCxWj1QvjE 3qLkyMclEjNz0+y4SaBcXIRxjKNVzTniKqhfWAh2FJGacy0ACSBk0j2RAQFQJ2LThfiD vAFLIrqnsHSLSk9Fc6DlQQpw9oh6LLb1VRSLOYJuHShC0tU5ry8b+op8qZ6tfMPVXxQn rfPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=s9wfiyI3JBIiISlABF9nzSzidRhd08PN5K7/7gRJUwU=; b=mgur85jgBFfpWwUeyMfJTBnefCBWvUr/XHieNj0CtZQgoNB4r6gML3Jz1SOauNbaCv nDjlcdj2zzS/+HBXbptHm6E76HfrP7R1wnE51ByovMpI/4mzVS5tI9FTs4jXR/r06efT dAKoxixBAauPz7jsXgAwl+Uoun4gL3TKZiGGni6VEpnltea0+jd0P9++Rns0z8Ti6JxZ V/6S2/aA7IXCVT1wMSFpqvCx43mAJ/yI2FG1p+fRKaXYLHuOO2qAxoud+l7+sQMBaly3 AAsekEZDrtjZxHzn5flmDirnd6SuIYkr75OiBZuukUar3tO4VvOoAZNDve1MQqpbN5BJ qbgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz-org.20210112.gappssmtp.com header.s=20210112 header.b=zgh0lqmx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvz.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k14-20020a170902ba8e00b00158d6f07b2esi7519964pls.85.2022.05.02.18.12.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 18:12:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@openvz-org.20210112.gappssmtp.com header.s=20210112 header.b=zgh0lqmx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=openvz.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 59D125DA57; Mon, 2 May 2022 17:53:23 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245024AbiD2FVA (ORCPT + 99 others); Fri, 29 Apr 2022 01:21:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239221AbiD2FU6 (ORCPT ); Fri, 29 Apr 2022 01:20:58 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63C2B66FB4 for ; Thu, 28 Apr 2022 22:17:39 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id n14so12056198lfu.13 for ; Thu, 28 Apr 2022 22:17:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=openvz-org.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=s9wfiyI3JBIiISlABF9nzSzidRhd08PN5K7/7gRJUwU=; b=zgh0lqmxqjAmYpfMJeInqwyar5RpKgn6nKPhjU0zE/mRkRAEOsvk01q11mzTkDptGi TwBcOx3EARcSI0hAy15m/EW2/0NDVnNDO95agwC6gbWdQLW4BjUE7CMli5n1iR5y8wOa g2LGTfB+wEs9BisfMzb6MrrgDQhrA5OanuAZ+TT5md3h2aag3jDAPyzctlDCCG97MKPQ e06ZJtfPG7utnP0hWSxpaUVfENEu7U2BcFuBCJbGdkJRiMjrPXJVr2P3nK0MraYFi6sz dmNYSv5MxKsD7AUI5Bf0T5Y0G9OWIbekQq8sNqNLeTRfjuqk1lZZeNVGgx24s+tILIfP 7Q2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=s9wfiyI3JBIiISlABF9nzSzidRhd08PN5K7/7gRJUwU=; b=6iXhYVkWMFMkPS5TmQKUjG5yCt4zayZt6PCy2Zzf8mI9rABKUI3LxafpOP5i1FLmG/ 3/dN1wH0i1nYv8IOajP8WphJTzIuXDvso/m35T3f0u1CWkmAnCeBYRHye/0frBVKfoG9 Ry5uDtgGF+wKEEyqI8NwhwksEYb7Eqjqgfc/zecu86Bu7/iRpCjrBOmBdjGV+tlNmQu0 Gb+LClOMfqH0ZPDRbAbthjWqzas2bqfpnmA3On0zH64W4Bbfr0OqxvSL3W1xTj+QyCSj VmLOoyBqKHZYjyemIupRtq+eavhQB7ImVjg0020R1Y7DJfn3XGXzDwlidP6lIjvfluU+ 7RSw== X-Gm-Message-State: AOAM5310msshvarYdgjovhsBx1+QbOPIlg1rzkbnHDw1D1cjn3G4PSXu +PTbnWLmCrZ3TnZ8jQNX5Idojw== X-Received: by 2002:a05:6512:902:b0:46b:c03f:19e5 with SMTP id e2-20020a056512090200b0046bc03f19e5mr26524304lft.118.1651209457725; Thu, 28 Apr 2022 22:17:37 -0700 (PDT) Received: from [192.168.43.196] ([185.174.128.251]) by smtp.gmail.com with ESMTPSA id y14-20020a19914e000000b00472085bfdf4sm141451lfj.133.2022.04.28.22.17.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 Apr 2022 22:17:37 -0700 (PDT) Message-ID: <0b28d49b-605c-ac1a-df85-643164e69039@openvz.org> Date: Fri, 29 Apr 2022 08:17:35 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: [PATCH net] net: enable memcg accounting for veth queues Content-Language: en-US To: Jakub Kicinski Cc: Roman Gushchin , Vlastimil Babka , Shakeel Butt , kernel@openvz.org, linux-kernel@vger.kernel.org, Michal Hocko , cgroups@vger.kernel.org, netdev@vger.kernel.org, "David S. Miller" , Paolo Abeni References: <1c338b99-8133-6126-2ff2-94a4d3f26451@openvz.org> <20220427095854.79554fab@kernel.org> From: Vasily Averin In-Reply-To: <20220427095854.79554fab@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.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 --- 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