Skip to content

Commit

Permalink
smp: Make generic_exec_single() public
Browse files Browse the repository at this point in the history
generic_exec_single() is quite handy for sending asynchronous IPIs without
the baggage that comes with smp_call_function_single_async(). Make it
public so that it can be (carefully) utilized.

Signed-off-by: Sultan Alsawaf <[email protected]>
Signed-off-by: Kazuki Hashimoto <[email protected]>
  • Loading branch information
kerneltoast authored and Official-Ayrton990 committed Jul 3, 2022
1 parent 9122624 commit c232299
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions include/linux/smp.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ extern void smp_cpus_done(unsigned int max_cpus);
/*
* Call a function on all other processors
*/
int generic_exec_single(int cpu, struct __call_single_data *csd,
smp_call_func_t func, void *info);
void smp_call_function(smp_call_func_t func, void *info, int wait);
void smp_call_function_many(const struct cpumask *mask,
smp_call_func_t func, void *info, bool wait);
Expand Down
5 changes: 3 additions & 2 deletions kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ static __always_inline void csd_lock(call_single_data_t *csd)

static __always_inline void csd_unlock(call_single_data_t *csd)
{
WARN_ON(!(csd->flags & CSD_FLAG_LOCK));
if (!(csd->flags & CSD_FLAG_LOCK))
return;

/*
* ensure we're all done before releasing data:
Expand All @@ -145,7 +146,7 @@ extern void send_call_function_single_ipi(int cpu);
* for execution on the given CPU. data must already have
* ->func, ->info, and ->flags set.
*/
static int generic_exec_single(int cpu, call_single_data_t *csd,
int generic_exec_single(int cpu, call_single_data_t *csd,
smp_call_func_t func, void *info)
{
if (cpu == smp_processor_id()) {
Expand Down

0 comments on commit c232299

Please sign in to comment.