forked from torvalds/linux
Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
smp: add a best_effort version of smp_call_function_many()
Regardless of the 'wait' argument, smp_call_function_many() must spin if any of the target CPUs have their csd busy waiting to be processed for a previous call. This may cause high tail latencies e.g. when some of the target CPUs are running functions that disable interrupts for a long time; getrusage() is one possible culprit. Here we introduce a variant, __smp_call_function_many(), that adds a third 'best_effort' mode to the two existing ones (nowait, wait). In best effort mode, the call will skip CPUs whose csd is busy, and if any CPU is skipped it returns -EBUSY and the set of busy in the mask. This allows the caller to decide how to proceed, e.g. it might retry at a later time, or use a private csd, etc.. The new function is a compromise to avoid touching existing callers of smp_call_function_many(). If the feature is considered interesting, we could even replace the 'wait' argument with a ternary 'mode' in all smp_call_function_*() and derived methods. Signed-off-by: Luigi Rizzo <lrizzo@google.com>
- Loading branch information
1 parent
5e46d1b
commit 9b290e2d29303b7c5bae4a0eddc5bb15c01e72f7
Showing
2 changed files
with
72 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters