From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 E477B241690 for ; Tue, 24 Feb 2026 14:05:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771941920; cv=none; b=pDXUcv7WynhrntPyn0gmdmTC5jJUtjy+D1pyAaN77PgphW2Vu44UpSj8sC2EK+TmRFqoi3lKA73PiyBrz/pLdvHexJ/69KsXvROP6x3E01v5PPuQHIYsNe45OtJ8c1m3feBAMJRp3caf2LQGFlg4V48NxsiaVxWLv2PM9W7Ebus= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771941920; c=relaxed/simple; bh=R/PrA4N6ZNknRV8L0VzocDd1tSfuIxxBcvNQAD/1pIY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hveXxY8jWtSRf8G+gY6je3/e1Gc5pfbfs2MjCjYXUQM2147rSq2DJXcxvKgJh7syqth4+sMgBbaKE8v5gJ9AGJq/v8nMsA1b+HojTKeRxpc2C9X/8wY0kvbB3DjbqvcDQ5TKktYupA0tDTBxH6sxeajbSbGUN4rHvwfQA3AqaCA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=RIks5QhV; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=nhBjxqzW; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="RIks5QhV"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="nhBjxqzW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1771941918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Ju7oSYrJ3M/BwJBkgi8YkBwI9TU+lSGFHRTi8J5bPvU=; b=RIks5QhV96zoBSLmD18k9Y0ViuCNgw1XhkEvF51tJLpcX872j475w2EprllVVGrNtBl/4G j5f24TDbIHrGM4Xxcr+Fh8bxQi/fPUE2LvFTgtcembL0mEElHYscA7cvEqcDikcxQYqE5d 3l5+YuwpSzMPqL+oEvY96Z9hPRlsjQ4= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-501-_lwoN8YlPKK-6NY7hKI3cg-1; Tue, 24 Feb 2026 09:05:16 -0500 X-MC-Unique: _lwoN8YlPKK-6NY7hKI3cg-1 X-Mimecast-MFC-AGG-ID: _lwoN8YlPKK-6NY7hKI3cg_1771941915 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-435af2d3144so3270063f8f.3 for ; Tue, 24 Feb 2026 06:05:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1771941915; x=1772546715; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Ju7oSYrJ3M/BwJBkgi8YkBwI9TU+lSGFHRTi8J5bPvU=; b=nhBjxqzW3nBaIUvidZ06PoJys+qQFS+R+AuOGuSun8kMaT63RkcS5uCY3JahAeabwf IZm/yriDZ2CnyefmC+WUz33Hvh5Bw+PpZ4mKesJiYZuxPPJ0RgmOGpbsJPXhF4Agdbj4 fokAsyGNH8OTkfDr97U705xuSguPRAzo+YU9YV34Cq5k8WN808omlFydKev0eN4MnSxZ QrO/KUYozXa/lEZo7992jg1JLkljtvIEN0IOuRLyOQIX54IN2xDMntxR4mwG+HiFaQhO k4gQ0vrqIgMpsvUmj1vXFMu0QHILLoi6SRF0JF2tYc70DI3MvBqoQi6E5aNus8jKHMrZ 1GQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771941915; x=1772546715; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ju7oSYrJ3M/BwJBkgi8YkBwI9TU+lSGFHRTi8J5bPvU=; b=BHKzX9BrTBEgkryaHvYa55pABwnX4MLq6c/toGo4KrqIBVBLY26XiwC7KDzXzh+xQl OFCqqscxSvrbZfIusHABWW6nAz6WNsH/HupyKx+WBhMg5KyYywGBxHgAW7SxpCEaOyAV 7XBheAucIc+pW+IquLsT9rp9n4nLUJSezeDyDDU9Hi71MnAE4xH/ysvJ/dtLl54YpjyQ jCeZxNRHysZzA6hvYMEYWFZLClJFtN0n8e+UHAlhYlNtGG928NhTwc0bEICMu6NNZXLX UYQO+7oBPNCWscS+9nwTxoCdkEXV9bBptIsbX3KRlh4rHW0mpzsDH0hAGKJJ5dzXSo0p P8iw== X-Forwarded-Encrypted: i=1; AJvYcCW/mxiHSvDstEk8qpu62DllmHYyungvGRF1hXXzEiMkSq+aqoJ/zMmh0Y5hLMcaNhelh9B6BzdQiF6NkT0=@vger.kernel.org X-Gm-Message-State: AOJu0YyZKY3DH/ja1Miex+/iFR5b/hxBuqxS2tAO+WGx80id6mimiwfu rbT5/XzN0Xm153lo3oWfsWEhypZuYpzkS9psYCgwTi7uQTiLo8xoQA7svbiw5C4U5d+TlSsvSDt 0qYG+Nu5nn7jC7mMgsSgoiw3b71DX+VmBGPkT6LRpTGIJqxn0O5iAw4eEmkuJL6r3Aw== X-Gm-Gg: ATEYQzw2PAaM19UT76XBmiaqYx3QuGbcMw5y7p7YlFE/S6DtpkYRzVDl16fU8KUfbxK FIUs1b454ypia/0HW2vf3fWg+oMffAzqFBoqq/0eNd1NeI1il3hieGvl8QSyxE9strPa3Ig3kVJ BhUtmiXRHSqExndweNi44mpaNM7/JND6lNuhm+1po9ZYkAnPxaZsANU/g5U5mzo3ydcbNEAszTb A0PBIKSbIwsbLd5e+DPKZ2gTq+L5N9GIWDkExPxegqaURjeFQLvk1L2WzxxOmiFjCpNctq+93rJ rZuK5Cb8uEhIiTXYBjHEdvONijJJxe5FbodZ38dTzbZK3yDybTCrhIgiuVyHRw47r6VoJzbTpDI 5nn8Wa/J4zZrDpOX6n7h2sfsYVMbm6rRlPnhmkXT5/6ILa321DKo= X-Received: by 2002:a05:6000:1ac8:b0:435:b755:c67e with SMTP id ffacd0b85a97d-4396f185667mr20032874f8f.49.1771941915236; Tue, 24 Feb 2026 06:05:15 -0800 (PST) X-Received: by 2002:a05:6000:1ac8:b0:435:b755:c67e with SMTP id ffacd0b85a97d-4396f185667mr20032798f8f.49.1771941914690; Tue, 24 Feb 2026 06:05:14 -0800 (PST) Received: from jlelli-thinkpadt14gen4.remote.csb ([151.29.73.19]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43970d54760sm26896332f8f.35.2026.02.24.06.05.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Feb 2026 06:05:13 -0800 (PST) Date: Tue, 24 Feb 2026 15:05:11 +0100 From: Juri Lelli To: Peter Zijlstra Cc: Ingo Molnar , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , Philip Auld , Gabriele Monaco , linux-kernel@vger.kernel.org, Bruno Goncalves Subject: Re: [PATCH] sched/deadline: Fix missing ENQUEUE_REPLENISH during PI de-boosting Message-ID: References: <20260206-upstream-fix-deadline-piboost-b4-v1-1-14043567b89c@redhat.com> <20260207084550.GU1282955@noisy.programming.kicks-ass.net> <20260224134552.GA596554@noisy.programming.kicks-ass.net> 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: <20260224134552.GA596554@noisy.programming.kicks-ass.net> On 24/02/26 14:45, Peter Zijlstra wrote: > On Mon, Feb 09, 2026 at 10:46:18AM +0100, Juri Lelli wrote: > > > > (afaict nothing clears dl_se::pi_se except rt_mutex_setprio() so that > > > should still be valid here -- so we don't need to go find it again) > > > > But, maybe with something like this? I believe we need to make things > > right at this point "promoting" the now becoming lower prio class task > > to DEADLINE (inheriting from the task it didn't inherit from in the > > past). Maybe we can avoid checking pi_task since dl_prio(newprio). And > > also move everything in an helper to remove ifdeffery. > > > > --- > > diff --git a/kernel/sched/syscalls.c b/kernel/sched/syscalls.c > > index 6f10db3646e7f..856df1a22e3ca 100644 > > --- a/kernel/sched/syscalls.c > > +++ b/kernel/sched/syscalls.c > > @@ -655,6 +655,16 @@ int __sched_setscheduler(struct task_struct *p, > > __setscheduler_params(p, attr); > > p->sched_class = next_class; > > p->prio = newprio; > > +#ifdef CONFIG_RT_MUTEXES > > + if (dl_prio(newprio) && !dl_policy(policy)) { > > + struct task_struct *pi_task = rt_mutex_get_top_task(p); > > + > > + if (pi_task) { > > + p->dl.pi_se = pi_task->dl.pi_se; > > + scope->flags |= ENQUEUE_REPLENISH; > > + } > > + } > > +#endif > > } > > __setscheduler_uclamp(p, attr); > > I'm still a bit confused on the pi_se thing; if this was a dl task, then > rt_mutex_setprio() would've already set this to pi_task->dl.pi_se, no? Let's say it's 'far from ideal', but we currently have if (dl_prio(prio)) { if (!dl_prio(p->normal_prio) || (pi_task && dl_prio(pi_task->prio) && dl_entity_preempt(&pi_task->dl, &p->dl))) { <-- p->dl.pi_se = pi_task->dl.pi_se; scope->flags |= ENQUEUE_REPLENISH; } else { p->dl.pi_se = &p->dl; } So, if the potential donor was DEADLINE, but with longer absolute deadline, we don't boost. But, if the donor is still potential, we can boost later when the holder becomes lower prio. > > Anyway, yes something like that, possibly with a helper sounds fine. > Will clean-up and resend. Thanks, Juri