Skip to content

Commit a5e37de

Browse files
TinyWindzzPeter Zijlstra
authored andcommitted
stop_machine: remove try_stop_cpus helper
try_stop_cpus is not used after this: commit c190c3b ("rcu: Switch synchronize_sched_expedited() to stop_one_cpu()") So remove it. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20191214195107.26480-1-tiny.windzz@gmail.com
1 parent d040e07 commit a5e37de

2 files changed

Lines changed: 0 additions & 37 deletions

File tree

‎include/linux/stop_machine.h‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ int stop_two_cpus(unsigned int cpu1, unsigned int cpu2, cpu_stop_fn_t fn, void *
3333
bool stop_one_cpu_nowait(unsigned int cpu, cpu_stop_fn_t fn, void *arg,
3434
struct cpu_stop_work *work_buf);
3535
int stop_cpus(const struct cpumask *cpumask, cpu_stop_fn_t fn, void *arg);
36-
int try_stop_cpus(const struct cpumask *cpumask, cpu_stop_fn_t fn, void *arg);
3736
void stop_machine_park(int cpu);
3837
void stop_machine_unpark(int cpu);
3938
void stop_machine_yield(const struct cpumask *cpumask);
@@ -90,12 +89,6 @@ static inline int stop_cpus(const struct cpumask *cpumask,
9089
return -ENOENT;
9190
}
9291

93-
static inline int try_stop_cpus(const struct cpumask *cpumask,
94-
cpu_stop_fn_t fn, void *arg)
95-
{
96-
return stop_cpus(cpumask, fn, arg);
97-
}
98-
9992
#endif /* CONFIG_SMP */
10093

10194
/*

‎kernel/stop_machine.c‎

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -453,36 +453,6 @@ int stop_cpus(const struct cpumask *cpumask, cpu_stop_fn_t fn, void *arg)
453453
return ret;
454454
}
455455

456-
/**
457-
* try_stop_cpus - try to stop multiple cpus
458-
* @cpumask: cpus to stop
459-
* @fn: function to execute
460-
* @arg: argument to @fn
461-
*
462-
* Identical to stop_cpus() except that it fails with -EAGAIN if
463-
* someone else is already using the facility.
464-
*
465-
* CONTEXT:
466-
* Might sleep.
467-
*
468-
* RETURNS:
469-
* -EAGAIN if someone else is already stopping cpus, -ENOENT if
470-
* @fn(@arg) was not executed at all because all cpus in @cpumask were
471-
* offline; otherwise, 0 if all executions of @fn returned 0, any non
472-
* zero return value if any returned non zero.
473-
*/
474-
int try_stop_cpus(const struct cpumask *cpumask, cpu_stop_fn_t fn, void *arg)
475-
{
476-
int ret;
477-
478-
/* static works are used, process one request at a time */
479-
if (!mutex_trylock(&stop_cpus_mutex))
480-
return -EAGAIN;
481-
ret = __stop_cpus(cpumask, fn, arg);
482-
mutex_unlock(&stop_cpus_mutex);
483-
return ret;
484-
}
485-
486456
static int cpu_stop_should_run(unsigned int cpu)
487457
{
488458
struct cpu_stopper *stopper = &per_cpu(cpu_stopper, cpu);

0 commit comments

Comments
 (0)