Thread (103 messages) 103 messages, 15 authors, 2024-01-16

Re: [PATCH v3 09/57] sched: Simplify ttwu()

From: Dan Carpenter <hidden>
Date: 2023-06-12 13:51:32
Also in: dmaengine, linux-kbuild, linux-perf-users, lkml, llvm, rcu

On Mon, Jun 12, 2023 at 11:07:22AM +0200, Peter Zijlstra wrote:
quoted hunk ↗ jump to hunk
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3664,16 +3664,15 @@ ttwu_stat(struct task_struct *p, int cpu
 		__schedstat_inc(p->stats.nr_wakeups_local);
 	} else {
 		struct sched_domain *sd;
+		guard(rcu)();
 
 		__schedstat_inc(p->stats.nr_wakeups_remote);
-		rcu_read_lock();
We can't put the guard(rcu)(); here?  I have unpublished static analysis
which assumes that the first and last statements guarded by a lock are
important.  But if we always put it at the top of the scope then we
lose that information.
 		for_each_domain(rq->cpu, sd) {
 			if (cpumask_test_cpu(cpu, sched_domain_span(sd))) {
 				__schedstat_inc(sd->ttwu_wake_remote);
 				break;
 			}
 		}
-		rcu_read_unlock();
 	}
regards,
dan carpenter
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help