Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4470778ioa; Wed, 27 Apr 2022 04:43:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPGXgMzyLknH9mntPKbqzcIsOArmUerY5hY5cUoYSpscGBcwYdCkfxFbOXtwtYpzhDobEu X-Received: by 2002:a05:6a00:14c5:b0:50d:4871:3619 with SMTP id w5-20020a056a0014c500b0050d48713619mr12360284pfu.12.1651059781774; Wed, 27 Apr 2022 04:43:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651059781; cv=none; d=google.com; s=arc-20160816; b=bGijSGu0cKTT0+wqGVAI/tEDtKpIvF9n50IddTrKRYlrsoaSANxl/qZdk+2HJ8RGTd 31brysXn1S5hoGBtVs49bKr+GTav5m9XuXBT4KICa0hzELjPvLkNJzSXroTUUuFzojK9 lOsXpOplGD0qi4/1bqn6lvUI9KMZot5T8VM/ZtyAwh9kwrSCMwwjeQRNgELIMfj6IkQF 1+e+01e3sISl8XOHAFwSjbeZR6Nm0Q9GQIKAK0eT3D13ur+ODLdBo3ql62Q6JOt1KLVK P/dXYx8QZj+b51obW7bN7lc+ds7GleG55ErsAvqp/CisxsQch/as86oQGmHiyizW+8Cd 8QBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language:cc:to :subject:from:user-agent:mime-version:date:message-id:dkim-signature; bh=s9wfiyI3JBIiISlABF9nzSzidRhd08PN5K7/7gRJUwU=; b=VSp5Flsgz4zojqbU2fmEViTK92VGQzHsZtc5b44mu5qBytJ6+i6byDNu/04Apg2OHL qoDr177E8qwASSMPnF5NB64jgeq2SnDzkLj0oVX3IH6xTrtK4pq5q1i1nJpHWTbSIajb O/b3L7CMkic8MJXysScYZutWC3eqCnqBprjMlIp00byqlea581fNJwla8xvlg2lxWKPz o9J8WUeEWYIAbpITgMz63aHKOcdMbN8CvBhLNZeFRsGEglBVM9AfApxx184xoHF+D+EE 2S44xsrl1w1xNKP+s3dhO7O0W8OZJPZu5aJmGrvL6IvrWc3XwoKbNg1/IpdvW21Cjsd2 lrDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@openvz-org.20210112.gappssmtp.com header.s=20210112 header.b=F1CrcAo2; 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 k5-20020a170902c40500b0015901ff4ebcsi1494756plk.306.2022.04.27.04.43.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 04:43:01 -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=F1CrcAo2; 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 F2D2F5536B; Wed, 27 Apr 2022 03:54:57 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230422AbiD0K6C (ORCPT + 99 others); Wed, 27 Apr 2022 06:58:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230481AbiD0K6B (ORCPT ); Wed, 27 Apr 2022 06:58:01 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AD8A3C0744 for ; Wed, 27 Apr 2022 03:34:33 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id k12so2333099lfr.9 for ; Wed, 27 Apr 2022 03:34:32 -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:from:subject:to:cc :content-language:content-transfer-encoding; bh=s9wfiyI3JBIiISlABF9nzSzidRhd08PN5K7/7gRJUwU=; b=F1CrcAo2L4t+g24hKYKTkJrAIVD+uTem+dr8Xe28yedKWFGtVI7PftZuZcQfKZcEOu z8H2qRwJPsk95KVz3cKAwjeZpfThWo2YICJwhmyX38kLU48FLwyTc4X1KU+Q0seSVK8o SIoNSv6HijNeKMGu+McRx0LPACtUYGfr9OFlNsr53DrbB25SZKsV46crOk2U2kaEeS1v n73RzjxPj+Dc+8m9++UWK2PmXlExBoFRwfte8OGfQKin+2u9FYxR9RdC7gS2PlqLFCVi 1bR/qi42emMrThTa7fgOLHgL2q7KukCh3+iI19VSkvx1t6PsRjP52JxxJxIyWn6CQNYp HqNw== 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:from :subject:to:cc:content-language:content-transfer-encoding; bh=s9wfiyI3JBIiISlABF9nzSzidRhd08PN5K7/7gRJUwU=; b=TpmitgDWZdVQTbcOmQw+TJa3PUIjfWSWQXQ9bTUA8fgJQ0CgULR63TheSqpfPHy1Tt 21HDniRKK0A5Pd2PE4DdzNrcpyOwCNX4iCxp65gj0tg136MvGXMNaRBNAQT4Wz4nZp0H qVb2qxhjo5ln2d25li1qKa72NPeXv40TPwC7GAGviM5WQ6/wzd/5JvC1QeCXV+1LFtAd kFbLPqKmlh3W06ZmnEvl61P9LJU4Aeufb6IkrBObuOMRenubHkrBJd5EEUqRcHHT1GJg ixaiB3BMGKjZyB+GBrnxRovZluf517M38vMjuUVQK1kB/SkZL3ok9tygYA5G3iRnGPax NTpQ== X-Gm-Message-State: AOAM530PIQccbpUKit83zYAH++b94TZ0h+kvvUVGxQG+Xd+Jm7XmFNbH XB+ewfHaIm6Xm89/7JCkPEWtbw== X-Received: by 2002:a05:6512:228e:b0:471:9022:c4d3 with SMTP id f14-20020a056512228e00b004719022c4d3mr19562388lfu.513.1651055671334; Wed, 27 Apr 2022 03:34:31 -0700 (PDT) Received: from [192.168.1.65] ([46.188.121.177]) by smtp.gmail.com with ESMTPSA id l21-20020a194955000000b00471f0aea31fsm1762928lfj.39.2022.04.27.03.34.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 27 Apr 2022 03:34:30 -0700 (PDT) Message-ID: <1c338b99-8133-6126-2ff2-94a4d3f26451@openvz.org> Date: Wed, 27 Apr 2022 13:34:29 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 From: Vasily Averin Subject: [PATCH] memcg: enable accounting for veth queues To: Roman Gushchin , Vlastimil Babka , Shakeel Butt Cc: kernel@openvz.org, linux-kernel@vger.kernel.org, Michal Hocko , cgroups@vger.kernel.org, netdev@vger.kernel.org, "David S. Miller" , Jakub Kicinski , Paolo Abeni Content-Language: en-US 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 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