From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 35036C4332F for ; Thu, 2 Nov 2023 16:03:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377042AbjKBQDa (ORCPT ); Thu, 2 Nov 2023 12:03:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46504 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbjKBQD2 (ORCPT ); Thu, 2 Nov 2023 12:03:28 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB2018E for ; Thu, 2 Nov 2023 09:03:22 -0700 (PDT) Date: Thu, 2 Nov 2023 17:03:19 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1698941001; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E31Rivc0vHXv+cwnNR0QYhaNHh+RRYw5uUf0+l97B58=; b=JDZIX+IsEts+IzBa9naikreJHN2RP4di4nlzsHWq90E0/lpN1aq56uIROvXYwhqm7zSQX6 AbrrMeEZs/ph54+bJUkMnLbBD3uXju7pil99XsbpznQmVkSAj7Bj7myYy46PbkUq9WZowq vANkoWu4dkiJ1ju+OatS/LKRHsoJxs8Ypyt0P4PmzdXXzmQiGBBePYh54HUmnQUzVbEup/ xo/vaJkwjhoJBAdvvycYdIKRb3Vhx3fDGrewgR/GgMs4yGTbHOELW+hsP2ktiXE9eUB5ur dboeoNN7sOlqpq7EWf0nICB6qkeFLFNfR2nrqWhOSaRW5ZoO8KFejV/OsHul8g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1698941001; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E31Rivc0vHXv+cwnNR0QYhaNHh+RRYw5uUf0+l97B58=; b=CJXtuKb8JFWMSWP8NUzVNWUeyFozLZ8e1I+H39tZpMYiFLLaOuJ8dKgFT4D3KoST58Vc6P cAI0y0U8z02ycMBQ== From: Sebastian Andrzej Siewior To: Juri Lelli Cc: linux-kernel@vger.kernel.org, Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Frederic Weisbecker , Ingo Molnar , John Stultz , Mel Gorman , Peter Zijlstra , Stephen Boyd , Steven Rostedt , Thomas Gleixner , Valentin Schneider , Vincent Guittot Subject: Re: [RFC PATCH 1/3] sched/core: Provide a method to check if a task is PI-boosted. Message-ID: <20231102160319.4rjz7ujq@linutronix.de> References: <20230804113039.419794-1-bigeasy@linutronix.de> <20230804113039.419794-2-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023-11-02 10:30:50 [+0100], Juri Lelli wrote: > Hi, Hi, > Apologies for noticing only now, but I believe this is still part of the > 6.6-rt patches and I've got the below question to ask. I'm not sure if we want this. I do have an alternative solution in the meantime. > > --- a/kernel/sched/core.c > > +++ b/kernel/sched/core.c > > @@ -8886,6 +8886,21 @@ static inline void preempt_dynamic_init(void) { } > > =20 > > #endif /* #ifdef CONFIG_PREEMPT_DYNAMIC */ > > =20 > > +/* > > + * task_is_pi_boosted - Check if task has been PI boosted. > > + * @p: Task to check. > > + * > > + * Return true if task is subject to priority inheritance. > > + */ > > +bool task_is_pi_boosted(const struct task_struct *p) > > +{ > > + int prio =3D p->prio; > > + > > + if (!rt_prio(prio)) > > + return false; > > + return prio !=3D p->normal_prio; >=20 > Does this need to also take DEADLINE tasks into consideration? We don't > change priority when they are boosted, only pi_se changes (please check > is_dl_boosted()). If we want this, then probably yes. Isn't task_struct::prio for the DL (boosted) task set to 0? While the RT priority go from 1=E2=80=A6MAX_RT_PRIO - 1. =20 > Thanks, > Juri Sebastian