libuv/src
Ben Noordhuis 434eb4b0ac
linux: handle cpu hotplugging in uv_cpu_info() (#3861)
On Linux, CPUs can come online or go offline while uv_cpu_info() is busy
gathering data. Change uv_cpu_info() in the following ways:

1. Learn online CPUs from /proc/stat

2. Get the model name from /proc/cpuinfo when it has a matching CPU,
   or default to "unknown"

3. Get speed from /sys/devices/system/cpu/cpu%u/cpufreq/scaling_cur_freq
   when it exists, or default to 0

Before this commit, libuv read the speed from /proc/cpuinfo but that
reports the base frequency, not the actual frequency. My system has
two cores running permanently at 3.6 GHz but libuv thought all 12 ran
at 2.2 GHz.

Fixes: https://github.com/libuv/libuv/issues/2351
Fixes: https://github.com/libuv/libuv/issues/3858
2023-01-14 05:08:15 +01:00
..
unix linux: handle cpu hotplugging in uv_cpu_info() (#3861) 2023-01-14 05:08:15 +01:00
win win: move child_stdio_buffer out of uv_process_t (#3850) 2022-12-09 13:27:52 +01:00
fs-poll.c win: fix style nits [NFC] (#3474) 2022-02-15 10:13:24 -05:00
heap-inl.h heap: fix heap_remove() 2014-05-23 20:04:42 +04:00
idna.c build: fix error C4146 on MSVC (#3271) 2022-02-13 00:57:43 -05:00
idna.h unix,win: support IDNA 2008 in uv_getaddrinfo() 2018-10-30 20:50:23 +01:00
inet.c unix,win: fix 'sprintf' is deprecated warning (#3813) 2022-11-08 09:56:14 +01:00
queue.h unix: use QUEUE_MOVE when iterating over lists 2015-10-08 21:47:43 +02:00
random.c build,unix: add QNX support 2020-09-22 23:14:46 -04:00
strscpy.c nfci: address some style nits 2020-08-21 17:25:42 -04:00
strscpy.h hurd: unbreak build on GNU/Hurd (#3450) 2022-02-23 12:04:18 -05:00
strtok.c core: add thread-safe strtok implementation (#3553) 2022-03-22 15:15:00 -04:00
strtok.h core: add thread-safe strtok implementation (#3553) 2022-03-22 15:15:00 -04:00
threadpool.c unix,win: give thread pool threads an 8 MB stack (#3787) 2022-10-18 23:06:47 +02:00
timer.c unix,win: initialize timer timeout field 2020-11-18 14:27:56 -05:00
uv-common.c linux: handle cpu hotplugging in uv_cpu_info() (#3861) 2023-01-14 05:08:15 +01:00
uv-common.h linux: handle cpu hotplugging in uv_cpu_info() (#3861) 2023-01-14 05:08:15 +01:00
uv-data-getter-setters.c nfci: address some style nits 2020-08-21 17:25:42 -04:00
version.c core: add UV_VERSION_HEX macro 2015-06-29 23:08:41 +02:00