Message ID | 20201112221543.3621014-8-guro@fb.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | BPF |
Headers | show |
Series | bpf: switch to memcg-based memory accounting | expand |
> On Nov 12, 2020, at 2:15 PM, Roman Gushchin <guro@fb.com> wrote: > > This patch enables memcg-based memory accounting for memory allocated > by __bpf_map_area_alloc(), which is used by many types of bpf maps for > large memory allocations. > > Following patches in the series will refine the accounting for > some of the map types. > > Signed-off-by: Roman Gushchin <guro@fb.com> Acked-by: Song Liu <songliubraving@fb.com> > --- > kernel/bpf/syscall.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c > index 2d77fc2496da..fcadf953989f 100644 > --- a/kernel/bpf/syscall.c > +++ b/kernel/bpf/syscall.c > @@ -280,7 +280,7 @@ static void *__bpf_map_area_alloc(u64 size, int numa_node, bool mmapable) > * __GFP_RETRY_MAYFAIL to avoid such situations. > */ > > - const gfp_t gfp = __GFP_NOWARN | __GFP_ZERO; > + const gfp_t gfp = __GFP_NOWARN | __GFP_ZERO | __GFP_ACCOUNT; > unsigned int flags = 0; > unsigned long align = 1; > void *area; > -- > 2.26.2 >
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c index 2d77fc2496da..fcadf953989f 100644 --- a/kernel/bpf/syscall.c +++ b/kernel/bpf/syscall.c @@ -280,7 +280,7 @@ static void *__bpf_map_area_alloc(u64 size, int numa_node, bool mmapable) * __GFP_RETRY_MAYFAIL to avoid such situations. */ - const gfp_t gfp = __GFP_NOWARN | __GFP_ZERO; + const gfp_t gfp = __GFP_NOWARN | __GFP_ZERO | __GFP_ACCOUNT; unsigned int flags = 0; unsigned long align = 1; void *area;
This patch enables memcg-based memory accounting for memory allocated by __bpf_map_area_alloc(), which is used by many types of bpf maps for large memory allocations. Following patches in the series will refine the accounting for some of the map types. Signed-off-by: Roman Gushchin <guro@fb.com> --- kernel/bpf/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)