lkml.org 
[lkml]   [2023]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 5/9] sched: Simplify ttwu()
Date
On 01/08/23 22:41, Peter Zijlstra wrote:
> Use guards to reduce gotos and simplify control flow.
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> ---
> kernel/sched/core.c | 221 +++++++++++++++++++++++++---------------------------
> 1 file changed, 109 insertions(+), 112 deletions(-)
>
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -3706,14 +3706,14 @@ ttwu_stat(struct task_struct *p, int cpu
> struct sched_domain *sd;
>
> __schedstat_inc(p->stats.nr_wakeups_remote);
> - rcu_read_lock();
> +
> + guard(rcu)();

This isn't strictly equivalent, right? AFAICT that pushes the
rcu_read_unlock() further down than it currently is - not a big deal, but
indentation aside scoped_guard() would preserve that.

\
 
 \ /
  Last update: 2023-08-09 17:22    [W:0.137 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site