[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEf4Bzbii9W=Frc3aPLrLsCWq1fFJXADhhQ4w7_d15ucqBuWHg@mail.gmail.com>
Date: Mon, 25 Nov 2019 12:38:26 -0800
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: John Fastabend <john.fastabend@...il.com>
Cc: Andrii Nakryiko <andriin@...com>, bpf <bpf@...r.kernel.org>,
Networking <netdev@...r.kernel.org>,
Alexei Starovoitov <ast@...com>,
Daniel Borkmann <daniel@...earbox.net>,
Kernel Team <kernel-team@...com>,
Johannes Weiner <hannes@...xchg.org>
Subject: Re: [PATCH bpf-next] mm: implement no-MMU variant of vmalloc_user_node_flags
On Mon, Nov 25, 2019 at 12:36 PM John Fastabend
<john.fastabend@...il.com> wrote:
>
> Andrii Nakryiko wrote:
> > To fix build with !CONFIG_MMU, implement it for no-MMU configurations as well.
> >
> > Cc: Johannes Weiner <hannes@...xchg.org>
> > Fixes: fc9702273e2e ("bpf: Add mmap() support for BPF_MAP_TYPE_ARRAY")
> > Reported-by: kbuild test robot <lkp@...el.com>
> > Signed-off-by: Andrii Nakryiko <andriin@...com>
> > ---
> > mm/nommu.c | 15 +++++++++++++--
> > 1 file changed, 13 insertions(+), 2 deletions(-)
> >
> > diff --git a/mm/nommu.c b/mm/nommu.c
> > index 99b7ec318824..7de592058ab4 100644
> > --- a/mm/nommu.c
> > +++ b/mm/nommu.c
> > @@ -155,11 +155,11 @@ void *__vmalloc_node_flags(unsigned long size, int node, gfp_t flags)
> > return __vmalloc(size, flags, PAGE_KERNEL);
> > }
> >
> > -void *vmalloc_user(unsigned long size)
> > +static void *__vmalloc_user_flags(unsigned long size, gfp_t flags)
> > {
> > void *ret;
> >
> > - ret = __vmalloc(size, GFP_KERNEL | __GFP_ZERO, PAGE_KERNEL);
> > + ret = __vmalloc(size, flags, PAGE_KERNEL);
> > if (ret) {
> > struct vm_area_struct *vma;
> >
> > @@ -172,8 +172,19 @@ void *vmalloc_user(unsigned long size)
> >
> > return ret;
> > }
> > +
> > +void *vmalloc_user(unsigned long size)
> > +{
> > + return __vmalloc_user_flags(size, GFP_KERNEL | __GFP_ZERO);
> > +}
> > EXPORT_SYMBOL(vmalloc_user);
> >
> > +void *vmalloc_user_node_flags(unsigned long size, int node, gfp_t flags)
> > +{
> > + return __vmalloc_user_flags(size, flags | __GFP_ZERO);
> > +}
> > +EXPORT_SYMBOL(vmalloc_user_node_flags);
> > +
>
> Hi Andrii, my first reaction was that it seemed not ideal to just ignore
> the node value like this but everything I came up with was uglier. I
> guess only user is BPF at the moment so it should be fine.
Yeah, but that's what other node-aware vmalloc() variants do in
nommu.c, so at least it's consistent with other cases. Thanks for
review!
>
> Acked-by: John Fastabend <john.fastabend@...il.com>
Powered by blists - more mailing lists