Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp66827ybg; Mon, 27 Jul 2020 15:49:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzv0AQOKG83KJM2bnqtmj5jQ4/JH3skxq1ccBDf+wB+F2cbtbl96fYSXSZ0NKbfbuwstS3k X-Received: by 2002:a50:bf09:: with SMTP id f9mr23022575edk.249.1595890189993; Mon, 27 Jul 2020 15:49:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595890189; cv=none; d=google.com; s=arc-20160816; b=Z+S3zuGKodLSw5HnMJMFTck2Zw462Yi8KPfY/aHnVLZ1/QIdDPYzUjepXYtQHDOEON 4XtWUMG2B9YReUjzDEXbKl8Srqph3Y+GpZicjnADqqVXyglZ0ynx9dWXkwq8sS8vREl8 nsY21WYH7u2k7L9pkN0k7hDIbkh3mxQBQQ+rXVxU6gVeLWED7QyVZn1dGXUm0ptPbeAT +LbDMPtxGHlLtOPyUjs2+em77eHLvQbi0BKxgeuGViAQNTAisX7Sp+qghyYA9/Fb3E0g 82BR8uMEmFxFNizUnvcy5E8b3Hjp7oDEz+ov6ZyiXsGfjRbwyzbxk1vagQ/zgftrWwfb 9J2g== 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=Aa87l/GiJS6HF/K0IHrywQWFc61CMJun26RXJGXXLaw=; b=vFa7TM8dzuW9IG5goH+IsWZD3omZy40Ek4GvXqLuRrk0eI4zQUaIQal+MlI9aD3n+o Gxl9gA9cXpVqSo1MMerX51FQ8GyZ2GpTz4lRp4XEfUtflqG3zvuwkV2pprwvUJaQ85de zT5kpsnAppb64cpBpyfFhuEgosOpNXPjmGfi4jhbOkQ2z/HudiFBO+6URj1f+6cPwwsU zg7vIDhsaNZwwxe/UtHyR3vm2OVSKVNGi0r7u56KaADj9a8Jkz6woas7ZopISj0qalWO 0X79skyNjAhGzx5dg/PzfHnWsKkmxhci6ayeT9+WpEyoyFEEylyZYPO7f9QH7YbQqFnE TbiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xzCYleq1; 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 pg13si2136540ejb.681.2020.07.27.15.49.28; Mon, 27 Jul 2020 15:49:49 -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=xzCYleq1; 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 S1727833AbgG0Wsi (ORCPT + 99 others); Mon, 27 Jul 2020 18:48:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:47500 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726193AbgG0Wsi (ORCPT ); Mon, 27 Jul 2020 18:48:38 -0400 Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (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 3E45B20829; Mon, 27 Jul 2020 22:48:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595890117; bh=TOhQZKza90iwMIAs1uYyFDZuUVL2WSyMrGnwMcLOZ68=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=xzCYleq179jMpqUj+riUZvWtokCxNkLGyi9QUytLv1xmdPD/hOdWJ+5dp6WDB9IX5 F0jnkjsbo4xfmVuhILvt8logioUQ3m5wRQMs13xvXZkG1A1phJTads/zOkLkZKQ75g PO8oFuvRJkWgxZuw5oVGkdI8JpKsUY/Pg8jNKfYs= Received: by mail-lj1-f179.google.com with SMTP id q6so19031826ljp.4; Mon, 27 Jul 2020 15:48:37 -0700 (PDT) X-Gm-Message-State: AOAM531oUZjFBmZvfAEwbgtJeG6tt+DbydJfkczr6Ydgyc3tiaDO4pmu 2I97ogRtGPXpdZWJa0Gnh/t1SvMgiSXFAs6IwSA= X-Received: by 2002:a2e:81c2:: with SMTP id s2mr2693713ljg.10.1595890115575; Mon, 27 Jul 2020 15:48:35 -0700 (PDT) MIME-Version: 1.0 References: <20200727184506.2279656-1-guro@fb.com> <20200727184506.2279656-5-guro@fb.com> In-Reply-To: <20200727184506.2279656-5-guro@fb.com> From: Song Liu Date: Mon, 27 Jul 2020 15:48:24 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH bpf-next v2 04/35] bpf: refine memcg-based memory accounting for cpumap 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:23 PM Roman Gushchin wrote: > > Include metadata and percpu data into the memcg-based memory accounting. > > Signed-off-by: Roman Gushchin Acked-by: Song Liu > --- > kernel/bpf/cpumap.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/kernel/bpf/cpumap.c b/kernel/bpf/cpumap.c > index f1c46529929b..74ae9fcbe82e 100644 > --- a/kernel/bpf/cpumap.c > +++ b/kernel/bpf/cpumap.c > @@ -99,7 +99,7 @@ static struct bpf_map *cpu_map_alloc(union bpf_attr *attr) > attr->map_flags & ~BPF_F_NUMA_NODE) > return ERR_PTR(-EINVAL); > > - cmap = kzalloc(sizeof(*cmap), GFP_USER); > + cmap = kzalloc(sizeof(*cmap), GFP_USER | __GFP_ACCOUNT); > if (!cmap) > return ERR_PTR(-ENOMEM); > > @@ -418,7 +418,7 @@ static struct bpf_cpu_map_entry * > __cpu_map_entry_alloc(struct bpf_cpumap_val *value, u32 cpu, int map_id) > { > int numa, err, i, fd = value->bpf_prog.fd; > - gfp_t gfp = GFP_KERNEL | __GFP_NOWARN; > + gfp_t gfp = GFP_KERNEL_ACCOUNT | __GFP_NOWARN; > struct bpf_cpu_map_entry *rcpu; > struct xdp_bulk_queue *bq; > > -- > 2.26.2 >