On Tue, Mar 10, 2015 at 3:55 AM, Tuukka Tikkanen idlestat@tic0.net wrote:
On Tue, 10 Mar 2015, Amit Kucheria wrote:
On Wed, Jan 28, 2015 at 7:58 PM, Tuukka Tikkanen idlestat@tic0.net wrote:
Previously any directory entry in /sys/devices/system/cpu/ with the substring "cpu" within the name would be considered to be a subdirectory for a cpu. The substring should begin the name, not just appear within the name.
OK. Will apply.
But what directories do you see other than cpuX, cpuidle and cpufreq under /sys/devices/system/cpu/ ?
All the patch does is changes the match from "^.*cpu.*$" to "^cpu.*$" (aka "cpu" to "^cpu") in terms of regular expressions. As all the (current) cpu entries have the "cpu" substring in the beginning of the name, it is the proper thing to do.
This is not really fixing any current realized problem as far as I know of. It was simply something I happened to come across while fixing the issue of hotplugged cpus. While it is still not bulletproof against arbitrary changes in future kernels, it is slightly more secure. The unpatched version would break if kernel introduced something like /sys/devices/system/cpu/online_cpus or /sys/devices/system/cpu/cpus_online while the patched version would break only on the latter.
Fair enough. Applied it to a local tree. Trying to fix a bug in the comparison mode introduced by 7f365110 before I push out all the changes.