Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp490441lqb; Wed, 29 May 2024 01:33:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUdyFwVDCCO6o2WrhIfpCHUS/KjXRGRuC+92yA4MeCqc9ZicfoPzE+D3LGzqXWUcrxY0r/+s8+iHP49us7vEtxs4lxmFCkictEoyf2R/g== X-Google-Smtp-Source: AGHT+IHLC8QZGVildUUTlKwkR+1eFla4gyBCs5AuzRts3md1/hhluZWNWW2J8TxImX9UjVqlg2RE X-Received: by 2002:ac8:5713:0:b0:43a:664f:e1c7 with SMTP id d75a77b69052e-43fb0e8f3afmr167201681cf.16.1716971617477; Wed, 29 May 2024 01:33:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716971617; cv=pass; d=google.com; s=arc-20160816; b=hdfNHCc3AvU0SORVv3kjxK7pN4r/P6GGbRxMKn1keIVqe+GLz0hN3jl7yFsxd+ddy2 wMPt9P8e5TbZ4/4lwib7VjlfyWVxAaoaD8wpo/AHuAjmCIcrjYNpTgf4+7TSP6uwEL2e WAUHwvzxguZc4Ckdy9LCXnnB8fiRxn0LeDa6TB4IB3Y2VatWBDbGWtWPrdf3FHWceSw4 d6OxOzg9qGNm4WHi0Y2eXfnVet7fEmwRZsJxblWHzXAVE7cNC9J9M6FbumugKRtnJ84/ bPARiSWIIlQFKMuxqSxi9+wF5zun0dNo2vUGYRxEMp/HLsqOnuuAHrc9R7g5LUvs3LfF dXIQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:dkim-signature :dkim-signature:date; bh=o9DQnDi62SVThmHsJFN8GzWXXKPHm4neh84ypARH/kY=; fh=PPZvyHn4NFTmc+39i1F+Zlldt/cCGqMNNOUKghc9hXQ=; b=MRsT5DSoaa8wAw48QmCbLAdpWXCfaMP7aa+5SJ97Ong5WC0ntjTVQbhNvMpB7T8uGv FXVRmI6pmVTt1HsEE8LfnKXLnk1+j09/b3YmBIfsP3GcS1HcvIzLV+xhnBvEX/rmJ03U T6efNzKqEP2DygjSA+Xrj/sSHZOMW5hCZm+0uBZzMTz7+qR/hjFSv2UmbZDe9wgahx79 D/EkIxYDCjnHnL2WL8DukYK6NTK6qT81GxcdV8vhuNGmkEfJa0819jHTUy61QT2NS9Ht imR13bzAZV3LL6o9dCqYaIloABvw2Jrj4QwJRmRCm7fp0EUGDASqYd9tsXu4Z/o1dyF+ Umzg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=SRPNYFeO; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="rAokD/kt"; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-193747-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193747-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43fbf8056cfsi103670011cf.45.2024.05.29.01.33.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 01:33:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-193747-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=SRPNYFeO; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="rAokD/kt"; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-193747-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193747-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 2B6951C20A15 for ; Wed, 29 May 2024 08:33:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5FC02174EE1; Wed, 29 May 2024 08:29:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="SRPNYFeO"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="rAokD/kt" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 40107169AD9; Wed, 29 May 2024 08:29:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716971356; cv=none; b=ZuBXN+ki5vd6+A2bUeajjTiQtsIkD5ehhLsXkDnEa7hxB5+hNpfovy0q3CRFnwbr+XdeLxlc3qs/cOMlh2Bzb0HaIL2UqypPV9JApk8f4+tAG613d5mKM0j8dCDRmCR2GVBUKEp/QaQot0DvBshe1W/6VBn11GWz4BOEahA7Q60= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716971356; c=relaxed/simple; bh=o9DQnDi62SVThmHsJFN8GzWXXKPHm4neh84ypARH/kY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QX7Cnmzl2Avc6IZN6+y5UMRVekir9D7UD8jpR13LVURd9FYTJia1ZS+mrcygZc0ARUz11qRyTsrLWT+knkV5DDVKk7kOuNxrCmc9owHjSs/qcLIYE5xr3z2gngs8mi5Kecj+ZVZ+u5K9zj393b10Gw2p2mcLG60WUrenVYcLChA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=SRPNYFeO; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=rAokD/kt; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Wed, 29 May 2024 10:29:12 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1716971353; 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=o9DQnDi62SVThmHsJFN8GzWXXKPHm4neh84ypARH/kY=; b=SRPNYFeOAAQ6EO5TmISg+WdT5xutmuEvGiHVPiLk25JF94IvoO5dJe74+yTlf+DsVN1+3o NPprB2daAAUrPDhsX3A77MeaqdhBxfcCBrc1U+p4hQGJmJ2vCdnBZHifjh7Au/EyYZyy48 eN2gSKSyo6HPBxwLSjqbON6PvxdgfJE9sDcN9lZ8ZHJGRNhXB2gHiGac0VJv8ht3dFGK2j F1raEtP3dyshOrsuQc452RucueZ9nPqZSBOSWeE667FRSeHDAu77un7wZNNJ8hdZpApqfI /dQVgOKXP9T1J8ZpTzvli/9R8iB9UQMWg5WiHD/UUt2jBGHUMe5gYscrwf2pDg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1716971353; 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=o9DQnDi62SVThmHsJFN8GzWXXKPHm4neh84ypARH/kY=; b=rAokD/ktxO9WLt/FyEsByG7MpgD69acVBS3P8Uyiz3JZZBqcPShAqUFCb1T1KDpFYJfRac soZjOVMB1ERztlCA== From: Sebastian Andrzej Siewior To: Qais Yousef Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Steven Rostedt , Vincent Guittot , Daniel Bristot de Oliveira , Thomas Gleixner , Alexander Viro , Christian Brauner , Andrew Morton , Jens Axboe , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-mm@kvack.org, Phil Auld Subject: Re: [PATCH v2] sched/rt: Clean up usage of rt_task() Message-ID: <20240529082912.gPDpgVy3@linutronix.de> References: <20240515220536.823145-1-qyousef@layalina.io> <20240521110035.KRIwllGe@linutronix.de> <20240527172650.kieptfl3zhyljkzx@airbuntu> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20240527172650.kieptfl3zhyljkzx@airbuntu> On 2024-05-27 18:26:50 [+0100], Qais Yousef wrote: > > In order to be PI-boosted you need to acquire a lock and the only lock > > you can sleep while acquired without generating a warning is a mutex_t > > (or equivalent sleeping lock) on PREEMPT_RT.=20 >=20 > Note we care about the behavior for !PREEMPT_RT. PI issues are important = there > too. I assume the fact the PREEMPT_RT changes the locks behavior is what = you're > referring to here and not applicable to normal case. So for !PREEMPT_RT you need a rtmutex for PI. RCU and i2c is using it within the kernel and this shouldn't go via the `slack' API. The FUTEX API on the other hand is a different story and it might matter. So you have one task running SCHED_OTHER and acquiring a lock in userspace (pthread_mutex_t, PTHREAD_PRIO_INHERIT). Another task running at SCHED_FIFO/ RR/ DL would also acquire that lock, block on it and then inherit its priority. This is the point where the former task has a different policy vs priority considering PI-boosting. You could argue that the task shouldn't sleep or invoke anything possible sleeping with a timeout > 0 because it is using an important lock. But then it is userland and has the freedom to do whatever it wants you know=E2=80=A6 So it might be better to forget what I said and keeping the current behaviour. But then it is insistent which matters only in the RT case. Puh. Any sched folks regarding policy? > Thanks! Sebastian