Re: [PATCH] perf/x86: check ucode before disabling PEBS onSandyBridge

From: Peter Zijlstra
Date: Fri Jun 08 2012 - 10:21:00 EST


On Fri, 2012-06-08 at 16:15 +0200, Borislav Petkov wrote:
> have a variable which gets initialized to the number of all CPUs and
> each time ->apply_microcode() finishes by returning 0, we decrement it
> once.

>
> Hmm, I'm probably missing some obscure case.

Since its all per-cpu sysfs muck, userspace could update a random
subsets of cpus.. leaving us hanging.

The 'bestestet' idea I came up with is doing the verify thing I have
from a delayed work -- say 1 second into the future. That way, when
there's lots of cpus they all try and enqueue the one work, which at the
end executes only once, provided the entire update scan took less than
the second.

But yuck..

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/