Skip to content

Commit 5356297

Browse files
KAGA-KOKOPeter Zijlstra
authored andcommitted
cpu/hotplug: Remove cpu_report_state() and related unused cruft
No more users. Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Tested-by: Michael Kelley <[email protected]> Tested-by: Oleksandr Natalenko <[email protected]> Tested-by: Helge Deller <[email protected]> # parisc Tested-by: Guilherme G. Piccoli <[email protected]> # Steam Deck Link: https://lore.kernel.org/r/[email protected]
1 parent 2711b8e commit 5356297

File tree

2 files changed

+0
-92
lines changed

2 files changed

+0
-92
lines changed

include/linux/cpu.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,6 @@ void arch_cpu_idle_enter(void);
184184
void arch_cpu_idle_exit(void);
185185
void __noreturn arch_cpu_idle_dead(void);
186186

187-
int cpu_report_state(int cpu);
188-
int cpu_check_up_prepare(int cpu);
189187
void cpu_set_state_online(int cpu);
190188
void play_idle_precise(u64 duration_ns, u64 latency_ns);
191189

kernel/smpboot.c

Lines changed: 0 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -329,97 +329,7 @@ EXPORT_SYMBOL_GPL(smpboot_unregister_percpu_thread);
329329
#ifndef CONFIG_HOTPLUG_CORE_SYNC
330330
static DEFINE_PER_CPU(atomic_t, cpu_hotplug_state) = ATOMIC_INIT(CPU_POST_DEAD);
331331

332-
/*
333-
* Called to poll specified CPU's state, for example, when waiting for
334-
* a CPU to come online.
335-
*/
336-
int cpu_report_state(int cpu)
337-
{
338-
return atomic_read(&per_cpu(cpu_hotplug_state, cpu));
339-
}
340-
341-
/*
342-
* If CPU has died properly, set its state to CPU_UP_PREPARE and
343-
* return success. Otherwise, return -EBUSY if the CPU died after
344-
* cpu_wait_death() timed out. And yet otherwise again, return -EAGAIN
345-
* if cpu_wait_death() timed out and the CPU still hasn't gotten around
346-
* to dying. In the latter two cases, the CPU might not be set up
347-
* properly, but it is up to the arch-specific code to decide.
348-
* Finally, -EIO indicates an unanticipated problem.
349-
*
350-
* Note that it is permissible to omit this call entirely, as is
351-
* done in architectures that do no CPU-hotplug error checking.
352-
*/
353-
int cpu_check_up_prepare(int cpu)
354-
{
355-
if (!IS_ENABLED(CONFIG_HOTPLUG_CPU)) {
356-
atomic_set(&per_cpu(cpu_hotplug_state, cpu), CPU_UP_PREPARE);
357-
return 0;
358-
}
359-
360-
switch (atomic_read(&per_cpu(cpu_hotplug_state, cpu))) {
361-
362-
case CPU_POST_DEAD:
363-
364-
/* The CPU died properly, so just start it up again. */
365-
atomic_set(&per_cpu(cpu_hotplug_state, cpu), CPU_UP_PREPARE);
366-
return 0;
367-
368-
case CPU_DEAD_FROZEN:
369-
370-
/*
371-
* Timeout during CPU death, so let caller know.
372-
* The outgoing CPU completed its processing, but after
373-
* cpu_wait_death() timed out and reported the error. The
374-
* caller is free to proceed, in which case the state
375-
* will be reset properly by cpu_set_state_online().
376-
* Proceeding despite this -EBUSY return makes sense
377-
* for systems where the outgoing CPUs take themselves
378-
* offline, with no post-death manipulation required from
379-
* a surviving CPU.
380-
*/
381-
return -EBUSY;
382-
383-
case CPU_BROKEN:
384-
385-
/*
386-
* The most likely reason we got here is that there was
387-
* a timeout during CPU death, and the outgoing CPU never
388-
* did complete its processing. This could happen on
389-
* a virtualized system if the outgoing VCPU gets preempted
390-
* for more than five seconds, and the user attempts to
391-
* immediately online that same CPU. Trying again later
392-
* might return -EBUSY above, hence -EAGAIN.
393-
*/
394-
return -EAGAIN;
395-
396-
case CPU_UP_PREPARE:
397-
/*
398-
* Timeout while waiting for the CPU to show up. Allow to try
399-
* again later.
400-
*/
401-
return 0;
402-
403-
default:
404-
405-
/* Should not happen. Famous last words. */
406-
return -EIO;
407-
}
408-
}
409-
410-
/*
411-
* Mark the specified CPU online.
412-
*
413-
* Note that it is permissible to omit this call entirely, as is
414-
* done in architectures that do no CPU-hotplug error checking.
415-
*/
416-
void cpu_set_state_online(int cpu)
417-
{
418-
(void)atomic_xchg(&per_cpu(cpu_hotplug_state, cpu), CPU_ONLINE);
419-
}
420-
421332
#ifdef CONFIG_HOTPLUG_CPU
422-
423333
/*
424334
* Wait for the specified CPU to exit the idle loop and die.
425335
*/

0 commit comments

Comments
 (0)