diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2017-10-17 17:55:54 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-10-19 15:13:50 +0300 |
commit | bc6d5031b43a2291de638ab9304320b4cae61689 (patch) | |
tree | c67f4312dd0af8422b5400b0442583660535df12 /kernel/bpf/hashtab.c | |
parent | 82f8dd28bd3abe181b7a66ea4ea132134d37a400 (diff) | |
download | linux-bc6d5031b43a2291de638ab9304320b4cae61689.tar.xz |
bpf: do not test for PCPU_MIN_UNIT_SIZE before percpu allocations
PCPU_MIN_UNIT_SIZE is an implementation detail of the percpu
allocator. Given we support __GFP_NOWARN now, lets just let
the allocation request fail naturally instead. The two call
sites from BPF mistakenly assumed __GFP_NOWARN would work, so
no changes needed to their actual __alloc_percpu_gfp() calls
which use the flag already.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'kernel/bpf/hashtab.c')
-rw-r--r-- | kernel/bpf/hashtab.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/kernel/bpf/hashtab.c b/kernel/bpf/hashtab.c index 431126f31ea3..6533f08d1238 100644 --- a/kernel/bpf/hashtab.c +++ b/kernel/bpf/hashtab.c @@ -317,10 +317,6 @@ static struct bpf_map *htab_map_alloc(union bpf_attr *attr) */ goto free_htab; - if (percpu && round_up(htab->map.value_size, 8) > PCPU_MIN_UNIT_SIZE) - /* make sure the size for pcpu_alloc() is reasonable */ - goto free_htab; - htab->elem_size = sizeof(struct htab_elem) + round_up(htab->map.key_size, 8); if (percpu) |