[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251020091325.GG3245006@noisy.programming.kicks-ass.net>
Date: Mon, 20 Oct 2025 11:13:25 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Thomas Gleixner <tglx@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
Gabriele Monaco <gmonaco@...hat.com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Michael Jeanson <mjeanson@...icios.com>,
Jens Axboe <axboe@...nel.dk>,
"Paul E. McKenney" <paulmck@...nel.org>,
"Gautham R. Shenoy" <gautham.shenoy@....com>,
Florian Weimer <fweimer@...hat.com>,
Tim Chen <tim.c.chen@...el.com>,
TCMalloc Team <tcmalloc-eng@...gle.com>
Subject: Re: [patch 16/19] sched/mmcid: Provide CID ownership mode fixup
functions
On Wed, Oct 15, 2025 at 07:29:54PM +0200, Thomas Gleixner wrote:
> +static bool mm_cid_fixup_task_to_cpu(struct task_struct *t, struct mm_struct *mm)
> +{
> + /* Remote access to mm::mm_cid::pcpu requires rq_lock */
> + guard(task_rq_lock)(t);
FWIW, an alternative to using task_rq(t) in combination with the guard()
above would be something like:
CLASS(task_rq_lock, rq_guard)(t);
struct rq *rq = rq_guard.rq;
> + if (t->mm != mm)
> + return false;
> + if (cid_on_task(t->mm_cid.cid)) {
> + /* If running on the CPU, transfer the CID, otherwise drop it */
> + if (task_rq(t)->curr == t)
> + mm_cid_transfer_to_cpu(t, per_cpu_ptr(mm->mm_cid.pcpu, task_cpu(t)));
> + else
> + mm_unset_cid_on_task(t);
> + }
> + return true;
> +}
Powered by blists - more mailing lists