Skip to content

Commit

Permalink
bpf: Skip unit_size checking for global per-cpu allocator
Browse files Browse the repository at this point in the history
  • Loading branch information
Hou Tao authored and mpe committed Sep 14, 2023
1 parent ddfd825 commit 6010d7d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions kernel/bpf/memalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6010d7d

Please sign in to comment.