From: Javier Carrasco <javier.carrasco.cruz@gmail.com>
To: Jonathan Corbet <corbet@lwn.net>
Cc: Javier Carrasco <javier.carrasco.cruz@gmail.com>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2] docs: scheduler: completion: Document complete_on_current_cpu()
Date: Sun, 24 Aug 2025 21:38:10 +0800 [thread overview]
Message-ID: <20250824-complete_on_current_cpu_doc-v2-1-fd13debcb020@gmail.com> (raw)
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>
---
Changes in v2:
- Rebase onto v6.17-rc1
- Fix patch formatting (drop --- before the Signed-off-by tag).
- Link to v1: https://lore.kernel.org/r/20250703-complete_on_current_cpu_doc-v1-1-262dc859b38a@gmail.com
---
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: 8f5ae30d69d7543eee0d70083daf4de8fe15d585
change-id: 20250702-complete_on_current_cpu_doc-94dfc72a39f8
Best regards,
--
Javier Carrasco <javier.carrasco.cruz@gmail.com>
next reply other threads:[~2025-08-24 13:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-24 13:38 Javier Carrasco [this message]
2025-08-29 22:44 ` [PATCH v2] docs: scheduler: completion: Document complete_on_current_cpu() Jonathan Corbet
2025-08-30 19:07 ` Peter Zijlstra
2025-08-31 10:04 ` Javier Carrasco
2025-09-03 21:54 ` Andrei Vagin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250824-complete_on_current_cpu_doc-v2-1-fd13debcb020@gmail.com \
--to=javier.carrasco.cruz@gmail.com \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.