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 0C9F4C25B6F for ; Thu, 26 Oct 2023 08:54:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6CE976B0345; Thu, 26 Oct 2023 04:54:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 654856B0347; Thu, 26 Oct 2023 04:54:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4CD956B0349; Thu, 26 Oct 2023 04:54:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 395306B0345 for ; Thu, 26 Oct 2023 04:54:46 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 11DFF1206B8 for ; Thu, 26 Oct 2023 08:54:46 +0000 (UTC) X-FDA: 81387002172.03.A69D427 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) by imf06.hostedemail.com (Postfix) with ESMTP id 57015180016 for ; Thu, 26 Oct 2023 08:54:44 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=PwTKzgqv; spf=none (imf06.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1698310484; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ZEBcz5oDJwulfgGWI6eBUOuuP2Vu4P0o4e5NZllAitM=; b=k8cfnRNjT/F7KEZ5TVVSgtZuiw0984xLxMdxzCpTmDyCdaYVfhzJcO6JRjFrmxbSCoWL3s Gj5UGiESO+Jn6CYHy7hb1I2uUpYMx2UH4sP7taB8KAEuMC7AdRfga3SDuFEa40Af9saJ1h MtxZexuDojvRgAAZ64KZZn0Py+xVdd0= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=PwTKzgqv; spf=none (imf06.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1698310484; a=rsa-sha256; cv=none; b=CzGr8HoeTM26NNvNthcc+4ljVUjhCxNlSsVanMsyb/VYQKMPbYobWaGEWm+GD60fAOhFwd EtHY9dWC0XCjkZ26g+BpMdtbpw0zLnk1KxSNzfei46iTxoZfzoxRHRuJOfM/fdOn+JEDxv ezSqtEj/vnzJet3SBV6lBygCfDqb7gI= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ZEBcz5oDJwulfgGWI6eBUOuuP2Vu4P0o4e5NZllAitM=; b=PwTKzgqvwdV9vqkNhbYrKz+zek Kon6ciA7lLWc3CH3oFeB3yz7K1FCn6sywGmYEw/yBrczmsPFg1BranwwmAr/W69KAcF5cdCQeoZPF NpNvU7gh9IyC359JYttetQBwZkEuIvfOwf33jiJogBpRKTVgbcKB/Hl6zy9nPlTWOiYBpScpWXhhX /pe8fHGSrwAT/i2ZNzXibH1JGhHivrNhyzcXsgolpORCmMUCrd5vAJHpgdpNx3DdG/c3ESzKBTtZ4 UoM3/JDu4XuhdJWnf2m8HjIoLhyHb+j/u8MoEIm+lnF9CVaW/LP2juXic+rGYxDZsjMgT33DNFwLO V/q8AstA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qvw86-00H9u7-2g; Thu, 26 Oct 2023 08:54:15 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 7949D300473; Thu, 26 Oct 2023 10:54:14 +0200 (CEST) Date: Thu, 26 Oct 2023 10:54:14 +0200 From: Peter Zijlstra To: Steven Rostedt Cc: Mateusz Guzik , Mathieu Desnoyers , LKML , Thomas Gleixner , Ankur Arora , Linus Torvalds , linux-mm@kvack.org, x86@kernel.org, akpm@linux-foundation.org, luto@kernel.org, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, willy@infradead.org, mgorman@suse.de, jon.grimm@amd.com, bharata@amd.com, raghavendra.kt@amd.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com, jgross@suse.com, andrew.cooper3@citrix.com, Joel Fernandes , Youssef Esmat , Vineeth Pillai , Suleiman Souhlal , Ingo Molnar , Daniel Bristot de Oliveira Subject: Re: [POC][RFC][PATCH] sched: Extended Scheduler Time Slice Message-ID: <20231026085414.GL31411@noisy.programming.kicks-ass.net> References: <20231025054219.1acaa3dd@gandalf.local.home> <20231025102952.GG37471@noisy.programming.kicks-ass.net> <20231025085434.35d5f9e0@gandalf.local.home> <20231025135545.GG31201@noisy.programming.kicks-ass.net> <20231025103105.5ec64b89@gandalf.local.home> <884e4603-4d29-41ae-8715-a070c43482c4@efficios.com> <20231025162435.ibhdktcshhzltr3r@f> <20231025131731.48461873@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231025131731.48461873@gandalf.local.home> X-Rspamd-Queue-Id: 57015180016 X-Rspam-User: X-Stat-Signature: 8174ygsgazagec46w8im6eh6panzdqo4 X-Rspamd-Server: rspam01 X-HE-Tag: 1698310484-112019 X-HE-Meta: U2FsdGVkX181yPzQeAQsKPh74Hv2Ds6/rmBf3vVtRdOFGWJGQLspzGOaET22pX50XIhbktBXl8ye7MB6ZYgljI2dbBZJvyShY8U03o6JvJJ5toeCFaPJ1S+YXYj5TXPgEExZLdlUymyf3Uqe4yiKycXVHhDibLL1nyKsjY9hkTrcweQPzuegGGlym1uZrslxMyZ+BCMmK54uFUThZ8Oa3VCPdgrbKZrqBUVY2tj9MgKH0uVFykdlOiSD3s//2/WhsiNn0AF14g5Vf1ZubNTeI8ZHeIvrEJNojpJeMrz1ayAtgTztlGIpmckcVGTJ/7R3IbNrqjgvNSgpWXD3xMDbZpKhIoskJOAkyyRBI7uUu8XPK00QSnJdTdukpd1ugin/PWTbWKntyPzRh/K2SxTKnKRyI2ppNuEZ2ubuCMFpeYzHvySB+/cVvrOLNPaVGmUscZXeE7+g/y17vmzvwrMqp7B3zxN8Yy6tivEIThHD+qO1Duh9KMUlNa6G7C+/XBnSn3yKMwtaaU2Vh/a7qtIUGmIRPxF8Ffcixolbkzrh7+KCkg4a3e+k6IUEVaoboAsxE8YDkmAZDf8/OGohjJ+SiAjNm8oaejRQIt23OeBowl6IPMNd1eqmua8lnsOjmvCKzNapCd9DJngQJ05hjV9X38GgPe7lKK5nhrF5IgjNZ35dGE94xbz705WL5paae7wJZCFCim0LYWgCWsM6fZI7CWXDUcr6p4MSg14OtyQLnoO86WcslwAhdcRHzTF8VCJS27gPHw1/9Yk1CBrhX+QRkYZinniY5RSGKS4ynu0bx5p1wLqkUodfzfHugg9K9wqaB8GvXa42ESIbYE968hugNQOdtiBECZJMasw2o1iN42z7lgizPeDOcjiyAOed1CT04ShDcLZ6PvyFPGTicb0yyvBqz83+rxVuQbRfG9/soFkGOLn96mFyWFWdcVl5ERj9SQGGKj1J8MikbOaFnsS LNv/Boob HGKcy7eeO4Tn1uBZxX6BTINuLZXV3mNEcTaVUiXvRizg0vO17EkyLCR9ROdXUTwmK4VlhnUiOhW+ZldhryMqL02RIiWy/Ys+0Qv9/jMSwxi+jlK8Odh9uj1iSWx5rbj/CoHC3uXFjJdn4WV4qNjWhbnLcCYEQC8DvII/dBacm/FaTXxraaUgCtDxVq6jKb3WKP5ErWZwmToqtteK6r74EWRHkziNPebeIIOmt 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 Wed, Oct 25, 2023 at 01:17:31PM -0400, Steven Rostedt wrote: > On Wed, 25 Oct 2023 18:24:35 +0200 > Mateusz Guzik wrote: > > > On Wed, Oct 25, 2023 at 11:42:34AM -0400, Mathieu Desnoyers wrote: > > > On 2023-10-25 10:31, Steven Rostedt wrote: > > > > On Wed, 25 Oct 2023 15:55:45 +0200 > > > > Peter Zijlstra wrote: > > > > > > [...] > > > > > > After digging lore for context, here are some thoughts about the actual > > > proposal: AFAIU the intent here is to boost the scheduling slice for a > > > userspace thread running with a mutex held so it can complete faster, > > > and therefore reduce contention. > > > > > > I suspect this is not completely unrelated to priority inheritance > > > futexes, except that one goal stated by Steven is to increase the > > > owner slice without requiring to call a system call on the fast-path. > > No, I wouldn't say it's the same as priority inheritance, which is to help > with determinism and not performance. PI adds overhead but removes > unbounded latency. On average, a non PI mutex is faster than PI mutex, but > can suffer from unbounded priority inversion. Matheusz is right though, what you're asking for is a (limited) priority ceiling, which is a very primitive form of PI, which itself is a very specific case of proxy execution :-) Note that in kernel spinners have this priority ceiling by means of preempt_disable(). > For this code, I took off my RT hat, and put on my performance hat. Seems to me you took the brain along with the hat. You're confusing cost of implementation with concept. Yes full blown PI is fairly expensive, but the concept is still valid. Priority ceilings were always an approximation.