lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 27 Jul 2020 15:48:24 -0700
From:   Song Liu <song@...nel.org>
To:     Roman Gushchin <guro@...com>
Cc:     bpf <bpf@...r.kernel.org>, Networking <netdev@...r.kernel.org>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Kernel Team <kernel-team@...com>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH bpf-next v2 04/35] bpf: refine memcg-based memory
 accounting for cpumap maps

On Mon, Jul 27, 2020 at 12:23 PM Roman Gushchin <guro@...com> wrote:
>
> Include metadata and percpu data into the memcg-based memory accounting.
>
> Signed-off-by: Roman Gushchin <guro@...com>

Acked-by: Song Liu <songliubraving@...com>

> ---
>  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
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ