summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/affinity.c
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2022-11-19 02:34:46 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2022-12-02 19:22:33 +0100
commit75d7ba32f9829e778484cf6e96e6e8f80914b0b3 (patch)
tree84e0c2d67e2c6b35138bfd9ecf13e5e99677399b /tools/perf/util/affinity.c
parenttools: Take @bit as an "unsigned long" in {clear,set}_bit() helpers (diff)
downloadlinux-75d7ba32f9829e778484cf6e96e6e8f80914b0b3.tar.xz
linux-75d7ba32f9829e778484cf6e96e6e8f80914b0b3.zip
perf tools: Use dedicated non-atomic clear/set bit helpers
Use the dedicated non-atomic helpers for {clear,set}_bit() and their test variants, i.e. the double-underscore versions. Depsite being defined in atomic.h, and despite the kernel versions being atomic in the kernel, tools' {clear,set}_bit() helpers aren't actually atomic. Move to the double-underscore versions so that the versions that are expected to be atomic (for kernel developers) can be made atomic without affecting users that don't want atomic operations. No functional change intended. Signed-off-by: Sean Christopherson <seanjc@google.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Message-Id: <20221119013450.2643007-6-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/perf/util/affinity.c')
-rw-r--r--tools/perf/util/affinity.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/affinity.c b/tools/perf/util/affinity.c
index 4ee96b3c755b..38dc4524b7e8 100644
--- a/tools/perf/util/affinity.c
+++ b/tools/perf/util/affinity.c
@@ -58,14 +58,14 @@ void affinity__set(struct affinity *a, int cpu)
return;
a->changed = true;
- set_bit(cpu, a->sched_cpus);
+ __set_bit(cpu, a->sched_cpus);
/*
* We ignore errors because affinity is just an optimization.
* This could happen for example with isolated CPUs or cpusets.
* In this case the IPIs inside the kernel's perf API still work.
*/
sched_setaffinity(0, cpu_set_size, (cpu_set_t *)a->sched_cpus);
- clear_bit(cpu, a->sched_cpus);
+ __clear_bit(cpu, a->sched_cpus);
}
static void __affinity__cleanup(struct affinity *a)