]> www.infradead.org Git - users/mchehab/rasdaemon.git/commit
Check CPUs online, not configured.
authorZeph / Liz Loss-Cutler-Hull <warp-spam_git@aehallh.com>
Sun, 9 Jul 2023 11:57:19 +0000 (04:57 -0700)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Mon, 23 Oct 2023 09:06:23 +0000 (11:06 +0200)
commitf1ea76375281001cdf4a048c1a4a24d86c6fbe48
tree05977ce1a166ee693b28418970b353f12cfcd838
parentf63b4c942e19a0da1e85a88783ed6e222ad4bdba
Check CPUs online, not configured.

When the number of CPUs detected is greater than the number of CPUs in
the system, rasdaemon will crash when it receives some events.

Looking deeper, we also fail to use the poll method for similar reasons
in this case.

All of this can be prevented by checking to see how many CPUs are
currently online (sysconf(_SC_NPROCESSORS_ONLN)) instead of how many
CPUs the current kernel was configured to support
(sysconf(_SC_NPROCESSORS_CONF)).

For the kernel side of the discussion, see https://lore.kernel.org/lkml/CAM6Wdxft33zLeeXHhmNX5jyJtfGTLiwkQSApc=10fqf+rQh9DA@mail.gmail.com/T/
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
ras-events.c