mirror of
https://github.com/torvalds/linux.git
synced 2024-11-15 00:21:59 +00:00
56fbc24116
Having static variable `cpus` in libbpf_num_possible_cpus function
without guarding it with mutex makes this function thread-unsafe.
If multiple threads accessing this function, in the current form; it
leads to incrementing the static variable value `cpus` in the multiple
of total available CPUs.
Used local stack variable to calculate the number of possible CPUs and
then updated the static variable using WRITE_ONCE().
Changes since v1:
* added stack variable to calculate cpus
* serialized static variable update using WRITE_ONCE()
* fixed Fixes tag
Fixes:
|
||
---|---|---|
.. | ||
api | ||
bpf | ||
lockdep | ||
subcmd | ||
symbol | ||
traceevent | ||
argv_split.c | ||
bitmap.c | ||
ctype.c | ||
find_bit.c | ||
hweight.c | ||
rbtree.c | ||
str_error_r.c | ||
string.c | ||
vsprintf.c | ||
zalloc.c |