This patch is on top of https://lkml.org/lkml/2015/9/2/413
In master, there's only a single function -
And similar function is on review mentioned above.
The algorithm for them is like this:
- there's system-wide boolean marker for the feature that is
- there's also updater for the feature that may disable it
system-widely if feature is not supported on current CPU.
- updater is called for each CPU on bootup.
The problem is the way updater does its work. On each CPU, it
unconditionally updates system-wide marker. For multi-core
system it makes CPU issue invalidate message for a cache
line containing marker. This invalidate increases cache
contention for nothing, because there's a single marker reset
that is really needed, and the others are useless.
If the number of system-wide markers of this sort will grow,
it may become a trouble on large-scale SOCs. The fix is trivial,
though: do system-wide marker update conditionally, and preserve
corresponding cache line in shared state for all update() calls,
except, probably, one.