[PATCH 05/14] bpf: Allow no charge in bpf_map_area_alloc

From
Yafang Shao <hidden>
Date
2022-03-19 17:30:57
Also in
bpf, linux-kselftest
Reply to
Yafang Shao, 2022-03-19
Use the helper we introduced before to decide whether set the
__GFP_ACCOUNT or not.

Signed-off-by: Yafang Shao <redacted>
---
 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
Thread (19 messages) 19 messages, 2 authors, last reply 2022-03-23
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help