mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] docs: scheduler: completion: Document complete_on_current_cpu()
@ 2025-07-02 18:26 Javier Carrasco
  0 siblings, 0 replies; only message in thread
From: Javier Carrasco @ 2025-07-02 18:26 UTC (permalink / raw)
  To: Jonathan Corbet; +Cc: linux-doc, linux-kernel, Javier Carrasco

Commit 6f63904c8f3e ("sched: add a few helpers to wake up tasks on the
current cpu") introduced this new function to the completion API that
has not been documented yet.

Document complete_on_current_cpu() explaining what it does and when its
usage is justified.

---
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---

Currently, there is a single user of this function (the one that
justified its introduction), and I emphasized the need for a good reason
to use this variant instead of complete() or complete_all() to avoid
abuse after reading "something about faster context switching".
---
 Documentation/scheduler/completion.rst | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/scheduler/completion.rst b/Documentation/scheduler/completion.rst
index adf0c0a56d02..db9c131f0b62 100644
--- a/Documentation/scheduler/completion.rst
+++ b/Documentation/scheduler/completion.rst
@@ -272,6 +272,10 @@ Signaling completion from IRQ context is fine as it will appropriately
 lock with spin_lock_irqsave()/spin_unlock_irqrestore() and it will never
 sleep.
 
+Use complete_on_current_cpu() to wake up the task on the current CPU.
+It makes use of the WF_CURRENT_CPU flag to move the task to be woken up
+to the current CPU, achieving faster context switches. To use this variant,
+the context switch speed must be relevant and the optimization justified.
 
 try_wait_for_completion()/completion_done():
 --------------------------------------------

---
base-commit: 66701750d5565c574af42bef0b789ce0203e3071
change-id: 20250702-complete_on_current_cpu_doc-94dfc72a39f8

Best regards,
--  
Javier Carrasco <javier.carrasco.cruz@gmail.com>


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-07-02 18:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-02 18:26 [PATCH] docs: scheduler: completion: Document complete_on_current_cpu() Javier Carrasco

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®