[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251128100659.GY4067720@noisy.programming.kicks-ass.net>
Date: Fri, 28 Nov 2025 11:06:59 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...hat.com>,
Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>,
Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
Valentin Schneider <vschneid@...hat.com>
Subject: Re: [PATCH v3 REPOST] sched: Remove a preempt-disable section in
rt_mutex_setprio()
On Thu, Nov 27, 2025 at 04:55:29PM +0100, Sebastian Andrzej Siewior wrote:
> rt_mutex_setprio() has only one caller: rt_mutex_adjust_prio(). It
> expects that task_struct::pi_lock and rt_mutex_base::wait_lock are held.
> Both locks are raw_spinlock_t and are acquired with disabled interrupts.
>
> Nevertheless rt_mutex_setprio() disables preemption while invoking
> __balance_callbacks() and raw_spin_rq_unlock(). Even if one of the
> balance callbacks unlocks the rq then it must not enable interrupts
> because rt_mutex_base::wait_lock is still locked.
> Therefore interrupts should remain disabled and disabling preemption is
> not needed.
>
> Commit 4c9a4bc89a9cc ("sched: Allow balance callbacks for check_class_changed()")
> adds a preempt-disable section to rt_mutex_setprio() and
> __sched_setscheduler(). In __sched_setscheduler() the preemption is
> disabled before rq is unlocked and interrupts enabled but I don't see
> why it makes a difference in rt_mutex_setprio().
>
> Remove the preempt_disable() section from rt_mutex_setprio().
>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Thanks!
Powered by blists - more mailing lists