diff options
author | Hou Tao <houtao@huaweicloud.com> | 2023-09-13 15:56:04 +0800 |
---|---|---|
committer | Luis Chamberlain <mcgrof@kernel.org> | 2023-09-14 13:29:08 -0700 |
commit | f80d8a4719f2b7cfd2761fbf6a9a9f1c1a6f237b (patch) | |
tree | b2b7d3076f3c320f05d4965db3b8b77e72ef9fa5 | |
parent | d1dc2ef0623e1b1ec5bda3c08ade88f995ad50b6 (diff) | |
download | linux-next-large-block-20230914.tar.gz |
bpf: Skip unit_size checking for global per-cpu allocatorlarge-block-20230914
For global per-cpu allocator, the size of free object in free list
doesn't match with unit_size and now there is no way to get the size of
per-cpu pointer saved in free object, so just skip the checking.
Signed-off-by: Hou Tao <houtao1@huawei.com>
-rw-r--r-- | kernel/bpf/memalloc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/kernel/bpf/memalloc.c b/kernel/bpf/memalloc.c index aad558cdc70f44..0ad175277f8980 100644 --- a/kernel/bpf/memalloc.c +++ b/kernel/bpf/memalloc.c @@ -491,6 +491,13 @@ static int check_obj_size(struct bpf_mem_cache *c, unsigned int idx) struct llist_node *first; unsigned int obj_size; + /* For per-cpu allocator, the size of free objects in free list doesn't + * match with unit_size and now there is no way to get the size of + * per-cpu pointer saved in free object, so just skip the checking. + */ + if (c->percpu_size) + return 0; + first = c->free_llist.first; if (!first) return 0; |