Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp100618ybg; Mon, 27 Jul 2020 16:56:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNq1YiA02aZBkxEct4fFplz2+cZ3TpD5xqgvQNoc3TSfr4vWRkH4/67eptgdR3ALcMX40m X-Received: by 2002:a17:906:3b45:: with SMTP id h5mr1455291ejf.136.1595894171446; Mon, 27 Jul 2020 16:56:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595894171; cv=none; d=google.com; s=arc-20160816; b=Q92rSZngssBp58hA1i7cLuQr58sY3qDFUEKrjbZffzywarqBeErN0USYiJ5bZ9zV+m MBIqoMk60udGmoIDE9+HQrZ398qztz6eybtqURbU5NOI50gS1YkomLs/xWeiN9U3MvjO zMUUoZbDQ1ukmM7NqdLdW8Dz+zekvk/upQcNKPDpY/ethM5uTWK+srJoARC/PUzeKxa7 AD1aSep8MYh0RHNF6poFuQUaDCLEHPaF4ONEIGEurYHd/04RipHxhXt1KK/smTI+sltH Qj/XvPUX/tFl/Jydpn8Y6ZtUi1GM0WYVx/ZR6xjkcBWEhSup3c/5Nv9TyBVQVZT2ku/R GRiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=4ohqVw75oMzUZAGfv5qBc2iKMhVRSfbxJV4OPLrr1uM=; b=cJHVOyYGiS5YJJeYWTvBW+RgvZDloE6KPYoHjn8asVqINgH70h6yV77+1EhyrvwiJS tXTsFglLzRwRPL7cvuI5eiUOcCyXQB4HP0AoJP+plUsLwm4hWYwd9J9iE0jqqhfdpROH KGuagsG9qAs+xft1mnU3Oybmi/JRpqF5CD0mQy6PS/OOwP/pwoFbGhDtqmot5tv4r8db mEPmYEVrWzFV3ZQw0uhEjZxe/E10nbu4sqJwTy30FREUxv0vrorOa2UC4uwa8hJ1hUJs rPge8Xd8lMqcsQcxd9aT50QHLqvrpQAUI1RhRMYDDEB/k9UwVcH7jPNiDqn403mCmjME 86og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=U9FV4pir; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v4si6740947edl.506.2020.07.27.16.55.46; Mon, 27 Jul 2020 16:56:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=U9FV4pir; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726884AbgG0Xzc (ORCPT + 99 others); Mon, 27 Jul 2020 19:55:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:46234 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726222AbgG0Xz3 (ORCPT ); Mon, 27 Jul 2020 19:55:29 -0400 Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6342B20809; Mon, 27 Jul 2020 23:55:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595894128; bh=pHjiLeoU+cX63+bW1MkEcT8iLXwc+EynwUf5ut3ZYrY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=U9FV4pir1v6rNVwRzwowB/oJrG0wJnrWZidOTdKkrTJCzAumBp8hLjT1x8r8BMpSd +qc+z5YKwo8lkdi9SuoXvrISkSdzkGTil0omZV9KnZWlMFRFKbCEr4ZW1GzwLQ3g2/ 92R7ewWlJ9Kv6riE+UqmiJ97RMjhETH1fdy8dCqg= Received: by mail-lf1-f41.google.com with SMTP id d2so4353633lfj.1; Mon, 27 Jul 2020 16:55:28 -0700 (PDT) X-Gm-Message-State: AOAM533P5X+U+2/JsJbw2N7Xb6WAQnUcAgeInqNKhMeKKcxuPXl79Da4 vMpwGbFyurrXTxIMcFbTWalGq7M9n1KfBvtvQaU= X-Received: by 2002:a05:6512:3a5:: with SMTP id v5mr12643913lfp.138.1595894126814; Mon, 27 Jul 2020 16:55:26 -0700 (PDT) MIME-Version: 1.0 References: <20200727184506.2279656-1-guro@fb.com> <20200727184506.2279656-9-guro@fb.com> In-Reply-To: <20200727184506.2279656-9-guro@fb.com> From: Song Liu Date: Mon, 27 Jul 2020 16:55:15 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH bpf-next v2 08/35] bpf: memcg-based memory accounting for lpm_trie maps To: Roman Gushchin Cc: bpf , Networking , Alexei Starovoitov , Daniel Borkmann , Kernel Team , open list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 27, 2020 at 12:22 PM Roman Gushchin wrote: > > Include lpm trie and lpm trie node objects into the memcg-based memory > accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > kernel/bpf/lpm_trie.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/kernel/bpf/lpm_trie.c b/kernel/bpf/lpm_trie.c > index 44474bf3ab7a..d85e0fc2cafc 100644 > --- a/kernel/bpf/lpm_trie.c > +++ b/kernel/bpf/lpm_trie.c > @@ -282,7 +282,7 @@ static struct lpm_trie_node *lpm_trie_node_alloc(const struct lpm_trie *trie, > if (value) > size += trie->map.value_size; > > - node = kmalloc_node(size, GFP_ATOMIC | __GFP_NOWARN, > + node = kmalloc_node(size, GFP_ATOMIC | __GFP_NOWARN | __GFP_ACCOUNT, > trie->map.numa_node); > if (!node) > return NULL; > @@ -557,7 +557,7 @@ static struct bpf_map *trie_alloc(union bpf_attr *attr) > attr->value_size > LPM_VAL_SIZE_MAX) > return ERR_PTR(-EINVAL); > > - trie = kzalloc(sizeof(*trie), GFP_USER | __GFP_NOWARN); > + trie = kzalloc(sizeof(*trie), GFP_USER | __GFP_NOWARN | __GFP_ACCOUNT); > if (!trie) > return ERR_PTR(-ENOMEM); > > -- > 2.26.2 >