[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220319173036.23352-6-laoar.shao@gmail.com>
Date: Sat, 19 Mar 2022 17:30:27 +0000
From: Yafang Shao <laoar.shao@...il.com>
To: roman.gushchin@...ux.dev, ast@...nel.org, daniel@...earbox.net,
andrii@...nel.org, kafai@...com, songliubraving@...com, yhs@...com,
john.fastabend@...il.com, kpsingh@...nel.org, shuah@...nel.org
Cc: netdev@...r.kernel.org, bpf@...r.kernel.org,
linux-kselftest@...r.kernel.org, Yafang Shao <laoar.shao@...il.com>
Subject: [PATCH 05/14] bpf: Allow no charge in bpf_map_area_alloc
Use the helper we introduced before to decide whether set the
__GFP_ACCOUNT or not.
Signed-off-by: Yafang Shao <laoar.shao@...il.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 f70a7067ef4a..add3b4045b4d 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -307,7 +307,7 @@ static void *__bpf_map_area_alloc(u64 size, union bpf_attr *attr, bool mmapable)
* __GFP_RETRY_MAYFAIL to avoid such situations.
*/
- const gfp_t gfp = __GFP_NOWARN | __GFP_ZERO | __GFP_ACCOUNT;
+ const gfp_t gfp = map_flags_no_charge(__GFP_NOWARN | __GFP_ZERO, attr);
int numa_node = bpf_map_attr_numa_node(attr);
unsigned long align = 1;
unsigned int flags = 0;
--
2.17.1
Powered by blists - more mailing lists