Re: [PATCH bpf-next 5/5] bpf: move memory size checks to bpf_map_charge_init()

2019-05-30 Thread Roman Gushchin
On Thu, May 30, 2019 at 11:56:55AM -0700, Song Liu wrote: > On Wed, May 29, 2019 at 6:05 PM Roman Gushchin wrote: > > > > Most bpf map types doing similar checks and bytes to pages > > conversion during memory allocation and charging. > > > > Let's unify these checks by moving them into bpf_map_ch

Re: [PATCH bpf-next 5/5] bpf: move memory size checks to bpf_map_charge_init()

2019-05-30 Thread Song Liu
On Wed, May 29, 2019 at 6:05 PM Roman Gushchin wrote: > > Most bpf map types doing similar checks and bytes to pages > conversion during memory allocation and charging. > > Let's unify these checks by moving them into bpf_map_charge_init(). > > Signed-off-by: Roman Gushchin Nice, I was thinking

[PATCH bpf-next 5/5] bpf: move memory size checks to bpf_map_charge_init()

2019-05-29 Thread Roman Gushchin
Most bpf map types doing similar checks and bytes to pages conversion during memory allocation and charging. Let's unify these checks by moving them into bpf_map_charge_init(). Signed-off-by: Roman Gushchin --- include/linux/bpf.h | 2 +- kernel/bpf/arraymap.c | 8 +---