Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp482097rdb; Thu, 2 Nov 2023 09:03:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHRmLs6Wi5Zq4FAoZoFYzi2tpuPTxGqkMhIpMSfXZ3TxwU3RgKwDFBFdnOfo8i7hAchRr8t X-Received: by 2002:a17:903:7c6:b0:1cc:630d:8a5e with SMTP id ko6-20020a17090307c600b001cc630d8a5emr8352591plb.48.1698941013259; Thu, 02 Nov 2023 09:03:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698941013; cv=none; d=google.com; s=arc-20160816; b=JExfGXSnGT0cmwji+Jo6ubW8anewQkGkqXvAAsmM+TXkaRScAk1zMx0u2F54FUtodT sCfYekytZ+G9FPgnzFTQ9SwLigaaudn6dSVWjcLio11WRtMgif9O0Px38hx2GDez9+lU CY0v072g9EceAYlezidiPC+pc8XoK6ElUJKm3GKT5ufCbf7kqHmL/Of6hiruSkGMEWLx 6K/bWnf0LCvjEcojZZEZZcMlJ/KTiUqGda+4BtEQwo+eZCzSHy7omJdtgYIViCE2mxJU OKk4H4lX6GS1HOZItClp0scXzjJk8rEHsuDKUX5LsscTLxaHM9upmWgJzcyv+TYDMX/h OJLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:dkim-signature:dkim-signature:date; bh=E31Rivc0vHXv+cwnNR0QYhaNHh+RRYw5uUf0+l97B58=; fh=Y9+WNrD6oe8UYgbOHlwtH0QDWytaO7DLQkLeoKxIUu0=; b=uDRhh3unWsZQDukXf78L/vxSWEPIiUfEIWJDD5dYdPCrBwvNT7Y0UUxwc7r56L8wSz 4yoIWL66wERCw3Whgnl6cJrE9mWttI6+uQpgD6EGlphR5NCqRbo4uiX2lujOZJxYYqBb lsawKjJQJ5u+3IGrwENCWfzThDqGsbSkgGn1cddXLzGh9LKpCtMIzOuNWG5nGXy8Rw9D 0gCvq9wmkTFKkP89X4UiQOcfEFZSTq1hY26N7h4T/JocT7sR6lmvnY3wcbbpvUVEze8x ZFZfV+pKlmBhHHl9hhSp6ijmfHFKc2NHHpvTHN1vyMnlRFzQmsDaBrglZUa8JdKkqpEc F4cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=JDZIX+Is; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id kz14-20020a170902f9ce00b001c737e1d3bfsi83007plb.237.2023.11.02.09.03.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 09:03:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=JDZIX+Is; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 54031827FFB5; Thu, 2 Nov 2023 09:03:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376960AbjKBQD3 (ORCPT + 99 others); Thu, 2 Nov 2023 12:03:29 -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: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 02 Nov 2023 09:03:32 -0700 (PDT) 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