[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <875xe10whv.ffs@tglx>
Date: Tue, 02 Sep 2025 16:17:32 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Mathieu Desnoyers <mathieu.desnoyers@...icios.com>, LKML
<linux-kernel@...r.kernel.org>
Cc: Jens Axboe <axboe@...nel.dk>, Peter Zijlstra <peterz@...radead.org>,
"Paul E. McKenney" <paulmck@...nel.org>, Boqun Feng
<boqun.feng@...il.com>, Paolo Bonzini <pbonzini@...hat.com>, Sean
Christopherson <seanjc@...gle.com>, Wei Liu <wei.liu@...nel.org>, Dexuan
Cui <decui@...rosoft.com>, x86@...nel.org, Arnd Bergmann <arnd@...db.de>,
Heiko Carstens <hca@...ux.ibm.com>, Christian Borntraeger
<borntraeger@...ux.ibm.com>, Sven Schnelle <svens@...ux.ibm.com>, Huacai
Chen <chenhuacai@...nel.org>, Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>
Subject: Re: [patch V2 26/37] rseq: Optimize event setting
On Tue, Aug 26 2025 at 11:26, Mathieu Desnoyers wrote:
>> Add a event flag, which is set when the CPU or MM CID or both change.
>
> We should figure out what to do for powerpc's dynamic numa node id
> to cpu mapping here.
:)
> The combination of patch
> "rseq: Simplify the event notification" and this
> ends up moving those three rseq_migrate events to __set_task_cpu:
>
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index be00629f0ba4..695c23939345 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -3364,7 +3364,6 @@ void set_task_cpu(struct task_struct *p, unsigned
> int new_cpu)
> if (p->sched_class->migrate_task_rq)
> p->sched_class->migrate_task_rq(p, new_cpu);
> p->se.nr_migrations++;
> - rseq_migrate(p);
> sched_mm_cid_migrate_from(p);
> perf_event_task_migrate(p);
> }
> @@ -4795,7 +4794,6 @@ int sched_cgroup_fork(struct task_struct *p,
> struct kernel_clone_args *kargs)
> p->sched_task_group = tg;
> }
> #endif
> - rseq_migrate(p);
> /*
> * We're setting the CPU for the first time, we don't migrate,
> * so use __set_task_cpu().
> @@ -4859,7 +4857,6 @@ void wake_up_new_task(struct task_struct *p)
> * as we're not fully set-up yet.
> */
> p->recent_used_cpu = task_cpu(p);
> - rseq_migrate(p);
> __set_task_cpu(p, select_task_rq(p, task_cpu(p), &wake_flags));
> rq = __task_rq_lock(p, &rf);
> update_rq_clock(rq);
>
> AFAIR those were placed in the callers to benefit from the conditional
> in set_task_cpu():
>
> if (task_cpu(p) != new_cpu) {
>
> perhaps it's not a big deal, but I think it's relevant to point it out.
They ended up setting the event all over the place. The only relevant
point which matters is __set_task_cpu().
Thanks,
tglx
Powered by blists - more mailing lists