On Mon, Sep 07, 2026 at 04:13:34PM +0800, Ye Liu wrote:
> From: Ye Liu <[email protected]>
>
> Replace guard(rcu)() + for_each_thread() with for_each_thread_rculock(),
> which scopes the RCU read lock to the loop body via scoped_guard(rcu).
>
> No functional change.
>
> Signed-off-by: Ye Liu <[email protected]>
> Reviewed-by: Justin Suess <[email protected]>
> Reviewed-by: Günther Noack <[email protected]>

LGTM so:

Reviewed-by: Lorenzo Stoakes (ARM) <[email protected]>

> ---
> Changes in v2:
>   - Rename *_rcu to *_rculock
>  security/landlock/tsync.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/security/landlock/tsync.c b/security/landlock/tsync.c
> index 0b71e158c3f5..a578af640aad 100644
> --- a/security/landlock/tsync.c
> +++ b/security/landlock/tsync.c
> @@ -335,9 +335,7 @@ static size_t count_additional_threads(const struct 
> tsync_works *works)
>
>       caller = current;
>
> -     guard(rcu)();

OK looked at the file and confirmed the function exits just after the below
section so fine :)

> -
> -     for_each_thread(caller, thread) {
> +     for_each_thread_rculock(caller, thread) {
>               /* Skip current, since it is initiating the sync. */
>               if (thread == caller)
>                       continue;
> @@ -376,9 +374,7 @@ static bool schedule_task_work(struct tsync_works *works,
>
>       caller = current;
>
> -     guard(rcu)();

Similar here.

> -
> -     for_each_thread(caller, thread) {
> +     for_each_thread_rculock(caller, thread) {
>               /* Skip current, since it is initiating the sync. */
>               if (thread == caller)
>                       continue;
> --
> 2.25.1
>

--
Cheers, Lorenzo

Reply via email to