lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANaxB-wK9JRWK8jwB6bPjPHd6=FM36Rzm5kTBv-XPjuh0+15GA@mail.gmail.com>
Date: Wed, 3 Sep 2025 14:54:11 -0700
From: Andrei Vagin <avagin@...il.com>
To: Javier Carrasco <javier.carrasco.cruz@...il.com>
Cc: Jonathan Corbet <corbet@....net>, linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org, 
	Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH v2] docs: scheduler: completion: Document complete_on_current_cpu()

On Sun, Aug 24, 2025 at 6:38 AM Javier Carrasco
<javier.carrasco.cruz@...il.com> wrote:
>
> 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@...il.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.

I think it's worth mentioning that this only makes sense if the
current task falls
asleep right after it wakes up the target task.

>
>  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@...il.com>
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ