diff options
author | Douglas Anderson <dianders@chromium.org> | 2023-05-27 03:41:37 +0200 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-06-20 01:25:28 +0200 |
commit | 813efda23934edcad96343fc96727017378c3fe9 (patch) | |
tree | b914278b1c632f9e72ffe70ef6cd39b8a04d469d /kernel/watchdog_buddy.c | |
parent | watchdog/buddy: cleanup how watchdog_buddy_check_hardlockup() is called (diff) | |
download | linux-813efda23934edcad96343fc96727017378c3fe9.tar.xz linux-813efda23934edcad96343fc96727017378c3fe9.zip |
watchdog/buddy: don't copy the cpumask in watchdog_next_cpu()
There's no reason to make a copy of the "watchdog_cpus" locally in
watchdog_next_cpu(). Making a copy wouldn't make things any more race
free and we're just reading the value so there's no need for a copy.
Link: https://lkml.kernel.org/r/20230526184139.7.If466f9a2b50884cbf6a1d8ad05525a2c17069407@changeid
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Suggested-by: Petr Mladek <pmladek@suse.com>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to '')
-rw-r--r-- | kernel/watchdog_buddy.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/watchdog_buddy.c b/kernel/watchdog_buddy.c index 3ffc5f2ede5a..2ef88722c5e7 100644 --- a/kernel/watchdog_buddy.c +++ b/kernel/watchdog_buddy.c @@ -10,12 +10,11 @@ static cpumask_t __read_mostly watchdog_cpus; static unsigned int watchdog_next_cpu(unsigned int cpu) { - cpumask_t cpus = watchdog_cpus; unsigned int next_cpu; - next_cpu = cpumask_next(cpu, &cpus); + next_cpu = cpumask_next(cpu, &watchdog_cpus); if (next_cpu >= nr_cpu_ids) - next_cpu = cpumask_first(&cpus); + next_cpu = cpumask_first(&watchdog_cpus); if (next_cpu == cpu) return nr_cpu_ids; |