On Thu, Aug 18, 2022 at 7:32 AM Yafang Shao <laoar.shao@xxxxxxxxx> wrote: > > Allocate pages related memory into the new helper > bpf_ringbuf_pages_alloc(), then it can be handled as a single unit. > > Suggested-by: Andrii Nakryiko <andrii.nakryiko@xxxxxxxxx> > Signed-off-by: Yafang Shao <laoar.shao@xxxxxxxxx> > --- > kernel/bpf/ringbuf.c | 80 ++++++++++++++++++++++++++++++++++++---------------- > 1 file changed, 56 insertions(+), 24 deletions(-) > LGTM. Acked-by: Andrii Nakryiko <andrii@xxxxxxxxxx> > diff --git a/kernel/bpf/ringbuf.c b/kernel/bpf/ringbuf.c > index 5eb7820..1e7284c 100644 > --- a/kernel/bpf/ringbuf.c > +++ b/kernel/bpf/ringbuf.c > @@ -59,6 +59,57 @@ struct bpf_ringbuf_hdr { > u32 pg_off; > }; > [...]