From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A844F2FD684 for ; Fri, 28 Nov 2025 10:07:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.92.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764324429; cv=none; b=XFg4gMIn+OTyMDaG53DsIigCvahPXbFIY+8TBHMnn1EQ8S5prGzT7Qmw9mAyDAEIuH3gAfwwyMOj9c1axfWIhzjpMrV0VGIyAS02gYfnU4psA1R9oNuprXmcIfM///qChZ29ahz1QWzm0Yx8AJTykyX3d9Z95iMBUmiQJTIQ2K4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764324429; c=relaxed/simple; bh=zcjYy7vYUA8BEprbaT8uBdgm+4z3q4eyyI4BE4+q8kA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Mbku8VmOfhmoeTC08x3w4mLAGkD4sEW9a1mwa8bKnnROhIt4uN/yNbRV4Mg2qUgJNgwEgUzrm7VyS8QOuZyLz2oO6taHpJVqHAEa++8qvuZGTIwHJlaxGSrW/8Whof8INuJCryuE/L+OEhn3diITcYDg488JhYVGXK3qX8t4Drw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=BjDJ8sbR; arc=none smtp.client-ip=90.155.92.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="BjDJ8sbR" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=pJ1hS9hTlCC4Lc27Bf0UGuVB2panam/yUC52/2TwB34=; b=BjDJ8sbRR10sgnm1Uh5RkprIwM Tk/4prZU8lfbeN2qBkXK61ewx5c5uBeF6x7YT7rP8bWS9KXKfUWbWJbj/WZ6NgvSN/jj1VK3Faaih JemU0//9s57SVR4F2bPdBn7Q2j5cGJJDznyw6Mi5W/GyaoGls43EY7tPXAHYbRB8+NWoxWDEmTKfg fsvgbOdDDD3l6UlEN/KHHevBNLY2Y+CmdDaWIkaVDLL7mzohjMqpzvLHSVHNCRLsvOXhtngt51ZmA qADP0O1nq0v11kryGSLIveKOaoGVYVlsy4CnLxjRv5IQlWuFvL4XSBUkO3qHfi/dphX67cihkWyU3 AHeys4Jw==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1vOuVt-0000000Bgu8-31Fo; Fri, 28 Nov 2025 09:11:38 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 25656300230; Fri, 28 Nov 2025 11:06:59 +0100 (CET) Date: Fri, 28 Nov 2025 11:06:59 +0100 From: Peter Zijlstra To: Sebastian Andrzej Siewior Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider Subject: Re: [PATCH v3 REPOST] sched: Remove a preempt-disable section in rt_mutex_setprio() Message-ID: <20251128100659.GY4067720@noisy.programming.kicks-ass.net> References: <20251127155529.t_sTatE4@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251127155529.t_sTatE4@linutronix.de> 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 Thanks!