Use get_online_cpus to avoid races involving CPU hotplug
v2 cover Use get_online_cpus to avoid races involving CPU hotplug
Hello,
This is the second version of the patches to fix races described in:
https://groups.google.com/forum/?fromgroups#!topic/linux.kernel/iSUDr94Qehc
The changes in this version are:
* fix commit log typo;
* prevent a race in via_cputemp_exit;
* and a new patch that prevents races during init/exit in drivers/hwmon/coretemp.c.
Silas
Quoted 4 lines · Silas Boyd-Wickizer
Hello,
This is the second version of the patches to fix races described in:
Quoted 8 lines
https://groups.google.com/forum/?fromgroups#!topic/linux.kernel/iSUDr94Qehc
The changes in this version are:
* fix commit log typo;
* prevent a race invia_cputemp_exit;
* and a new patch that prevents races during init/exit indrivers/hwmon/coretemp.c.
Hi Silas,
Good work! How did you find these?
Cheers,
Rusty.
Hi Rusty,
I used libsparse and kernel source annotations to check that code uses for_each_online_cpu in contexts with hotplug disabled
(e.g. get_online_cpus(), preempt_disable, ..). I compiled with an x86 64-bit allyesconfig, so I missed other architecture specific usages. The checker code isn't great and the results still require some manual inspection for weeding out false positives, etc:
http://pdos.csail.mit.edu/~sbw/online-checker/
Silas
Quoted 22 lines · Rusty Russell
Quoted 4 lines · Silas Boyd-Wickizer
Hello,
This is the second version of the patches to fix races described in:
Quoted 8 lines
https://groups.google.com/forum/?fromgroups#!topic/linux.kernel/iSUDr94Qehc
The changes in this version are:
* fix commit log typo;
* prevent a race invia_cputemp_exit;
* and a new patch that prevents races during init/exit indrivers/hwmon/coretemp.c.Hi Silas,
Good work! How did you find these?
Cheers,
Rusty.