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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80C6CC25B7E for ; Wed, 29 May 2024 08:29:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 995E36B00A4; Wed, 29 May 2024 04:29:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8AFD96B00A7; Wed, 29 May 2024 04:29:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5252C6B00A5; Wed, 29 May 2024 04:29:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 1F2B06B00A3 for ; Wed, 29 May 2024 04:29:18 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 87CFC120A5A for ; Wed, 29 May 2024 08:29:17 +0000 (UTC) X-FDA: 82170758754.14.DB80E56 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by imf10.hostedemail.com (Postfix) with ESMTP id A26AAC0020 for ; Wed, 29 May 2024 08:29:15 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=SRPNYFeO; dkim=pass header.d=linutronix.de header.s=2020e header.b="rAokD/kt"; spf=pass (imf10.hostedemail.com: domain of bigeasy@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=bigeasy@linutronix.de; dmarc=pass (policy=none) header.from=linutronix.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1716971355; h=from:from:sender: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:dkim-signature; bh=o9DQnDi62SVThmHsJFN8GzWXXKPHm4neh84ypARH/kY=; b=ZViKN4Xx74Rl9BudGMzu7RiUg10j5vw/TNiP4n7zrp5PYNo+nAZfLUdpySSvFtnHbi7SNQ 46taAsEPTAKU3vawZhPZc69kWeAC0+/+w9zIYAVhXnaDRsT0v4izcosbD37tWLCRFGasSJ OO+ObxOHKXC1OXm4paDEp4krr08BU70= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716971355; a=rsa-sha256; cv=none; b=ljEk38mMPwxRWmRrijGyAASJz8+GDKm24jSOXuUQ598upGgp/AYA/OOY2RsBu4AnGIMrB8 zTy63XgD+Ur4TMB3kuctD3wZaSQjk9VfKmrRJZVb4Dy7Bvsjziwfy7BF+3Y5uiaYBaaEqo nad84138kEWIUaxpx8DtQGwFHREgKog= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=linutronix.de header.s=2020 header.b=SRPNYFeO; dkim=pass header.d=linutronix.de header.s=2020e header.b="rAokD/kt"; spf=pass (imf10.hostedemail.com: domain of bigeasy@linutronix.de designates 193.142.43.55 as permitted sender) smtp.mailfrom=bigeasy@linutronix.de; dmarc=pass (policy=none) header.from=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> 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> X-Rspam-User: X-Stat-Signature: ssnx9ofywmqowbhthmbudk6t6dkfibrj X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: A26AAC0020 X-HE-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M3oC95H5Ds5bnPg1I476ySgEwX/Q9ZsCNehVnNOPFR+O3z7Xwk7SsLI+HKiUZlO3fIVLxlJNqW69DP0+DLqv/A== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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