Merge tag 'livepatching-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 3 Sep 2021 17:57:25 +0000 (10:57 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 3 Sep 2021 17:57:25 +0000 (10:57 -0700)
Pull livepatching update from Petr Mladek.

* tag 'livepatching-for-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching:
  livepatch: Replace deprecated CPU-hotplug functions.

kernel/livepatch/transition.c

index 3a4beb9395c48c9352ce21e7f108c9530ad61a52..291b857a6e20173901cc68d71f6bbefb6d889494 100644 (file)
@@ -411,7 +411,7 @@ void klp_try_complete_transition(void)
        /*
         * Ditto for the idle "swapper" tasks.
         */
-       get_online_cpus();
+       cpus_read_lock();
        for_each_possible_cpu(cpu) {
                task = idle_task(cpu);
                if (cpu_online(cpu)) {
@@ -423,7 +423,7 @@ void klp_try_complete_transition(void)
                        task->patch_state = klp_target_state;
                }
        }
-       put_online_cpus();
+       cpus_read_unlock();
 
        if (!complete) {
                if (klp_signals_cnt && !(klp_signals_cnt % SIGNALS_TIMEOUT))