aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/net/lib/py/nsim.py
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2024-06-10 14:46:35 +0200
committerPeter Zijlstra <peterz@infradead.org>2024-06-11 11:25:22 +0200
commitbb9bb45f746b0f9457de9c3fc4da143a6351bdc9 (patch)
tree7bfcd48b46b42f4b44d62e4823a40aefb82df248 /tools/testing/selftests/net/lib/py/nsim.py
parentc80c4490c280a1678e47d34d2a335a58f1318615 (diff)
perf/x86: Serialize set_attr_rdpmc()
Yue and Xingwei reported a jump label failure. It's caused by the lack of serialization in set_attr_rdpmc(): CPU0 CPU1 Assume: x86_pmu.attr_rdpmc == 0 if (val != x86_pmu.attr_rdpmc) { if (val == 0) ... else if (x86_pmu.attr_rdpmc == 0) static_branch_dec(&rdpmc_never_available_key); if (val != x86_pmu.attr_rdpmc) { if (val == 0) ... else if (x86_pmu.attr_rdpmc == 0) FAIL, due to imbalance ---> static_branch_dec(&rdpmc_never_available_key); The reported BUG() is a consequence of the above and of another bug in the jump label core code. The core code needs a separate fix, but that cannot prevent the imbalance problem caused by set_attr_rdpmc(). Prevent this by serializing set_attr_rdpmc() locally. Fixes: a66734297f78 ("perf/x86: Add /sys/devices/cpu/rdpmc=2 to allow rdpmc for all tasks") Closes: https://lore.kernel.org/r/CAEkJfYNzfW1vG=ZTMdz_Weoo=RXY1NDunbxnDaLyj8R4kEoE_w@mail.gmail.com Reported-by: Yue Sun <samsun1006219@gmail.com> Reported-by: Xingwei Lee <xrivendell7@gmail.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20240610124406.359476013@linutronix.de
Diffstat (limited to 'tools/testing/selftests/net/lib/py/nsim.py')
0 files changed, 0 insertions, 0 deletions