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 15E8DC0219E for ; Mon, 10 Feb 2025 17:21:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 830986B0088; Mon, 10 Feb 2025 12:21:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7B9EA6B0089; Mon, 10 Feb 2025 12:21:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 633E5280001; Mon, 10 Feb 2025 12:21:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 3FEC56B0088 for ; Mon, 10 Feb 2025 12:21:06 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id B75E21C5B32 for ; Mon, 10 Feb 2025 17:21:05 +0000 (UTC) X-FDA: 83104700490.01.6CB1994 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by imf24.hostedemail.com (Postfix) with ESMTP id C1A6F180008 for ; Mon, 10 Feb 2025 17:21:03 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=fsUmAAxc; spf=pass (imf24.hostedemail.com: domain of david.laight.linux@gmail.com designates 209.85.128.45 as permitted sender) smtp.mailfrom=david.laight.linux@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1739208063; 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=3ZBLqDU7qXFhhc3B/+6vLC/ZjO95kH1/L9KVNqoEbow=; b=77w6ZW4sgD2wQR16wGp2d4IO9QvlBOgsp7Te23it+Hi9B5drMrX88RKkjfdPQTZwfyKzpo 3vQWyRZ10yQ7+/Ntr4x67G6FbVEzqXqKvyHuSgkE1C059w+twDUEQzE4Grsc1J6KK25uLV WoUOeubQ5cMgaO2UEvgEWYYeTyQPtIs= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=fsUmAAxc; spf=pass (imf24.hostedemail.com: domain of david.laight.linux@gmail.com designates 209.85.128.45 as permitted sender) smtp.mailfrom=david.laight.linux@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1739208063; a=rsa-sha256; cv=none; b=24J8KhzzRwQFuf64WT/CpVdN1yU/eg39+RVE1rZp2RwEA8xL00kEAHFVzF75daWeTt1jEd cY3cc1uQJbMdyrbNjqlNyIBFKDYSOGhEXIKkwY8EihV9EMWcewDzyXMMHU6S4cfEM4a7c3 XVjNJb37ZonlwjOp84iUkHh0+wmwekQ= Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4394a0c65fcso8603765e9.1 for ; Mon, 10 Feb 2025 09:21:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739208062; x=1739812862; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=3ZBLqDU7qXFhhc3B/+6vLC/ZjO95kH1/L9KVNqoEbow=; b=fsUmAAxc3Lh9waxc+Pq/yPgiXLjs/4qMoDCgueUwMpA5SuVwJ5dTcvDpSb2Q0pg2px ft1JP3uq+4qKjfB4OGQnbtU3+qGq9ZJT4vhR9rVAokEkxdUfWASXhFYGg/XXfH43GdC2 +G3uNdOwnky4U4xxe0sRRfvkHD4kwmGseIpKVMhUat+3C7ylzM5qDjPmZgBcTM1sd4Ib JWD0crpchCYk61vwVP0sLz3KOBNpzAnJWTQ4K8x/kfvKS0g90iT3hHHWM6f2AkoKjIdc pvOCYY+D31RHyq2pk1PBCY8BQBQy1oCbzlz5VSTUIgFwraUHwQt6AkX+MaGelWwxPKBp QD2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739208062; x=1739812862; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3ZBLqDU7qXFhhc3B/+6vLC/ZjO95kH1/L9KVNqoEbow=; b=gxzIn7+GdkASSVY2dg4Pb6GiIFYF8A37A+qyJioCw7fQi/R68jB/+GDiEa2dxyZ0tB /lg4+Sx5ecbXoYKtxCK4RvzD7vb33XYWGKiKudp9MtlGH2puiYG5akeqINfW4t9jY45q gyjFR8vn5QZFKbDiSRBQO7S7o/pqRwvJY2IKm9EBfxxoCR3DXclJuVQ7pHqZC2/gxAIx 0U+ZkIpVeT6LPAZZ6ZJz2TbkovRb1gwPkHwKLGwCSN2BzlkGy8JI0WbfuQCSkezbXVWm 517b8eGbalUiR2VdubfecguAGNJCIXuNkMmYIJ1Bl9gKUzhLtqAhrSJMqjpDOTUyuedH DBtg== X-Forwarded-Encrypted: i=1; AJvYcCUrHcpUz6m4rO4UYdJXy4hCjNP0vFhyEETgpMkhXX6hcqRn73iQwDEq2dOyIwigakxO/5Mss6T7oA==@kvack.org X-Gm-Message-State: AOJu0YyQ5cB6I9ZRUX/2+6WJ1RGEs+GmU70t2FLOn0oE8qIEJYqpUnC1 9G4EpTsRgXni41c0L35kfVIPJwEkDMv6m95kCBKIbp24GaOnGraI X-Gm-Gg: ASbGncuREcEbP46ovXvq3jzw3okAfiDAbPpKDOSrDf1NRVuo8dbLkYVo4dKK/MaPVQx b/LybGHWL9QAIJWFq79aUsK6/ZqZOr38K3ACIqIewH6DCF/3uDOaziZSSYoD2Y9Pm92gWb99/5U qi2KisgxOmqcjnd+yG7OJ8+B7JgVKWZnyZktAu46cEHS0bdR0PqLJRTrLrgOTqZPhf2zmglr7Y2 7K7yJlMz+tIM556WLRo9UbpK0Lt+eI1rjttPx+TNVdXm0yInwzItXL8AFSVmj/e6lAqo9AOKrGQ s3LnXqlSoDr3Fx80J4Mxp+SwNyPzcLWlauKyyr0PUIDKrFkpowWWjg== X-Google-Smtp-Source: AGHT+IGwhZp7sR8qO7EodMLEWTI6zPWQZVM+o0lti9Zoirk7XA/gfdo2Qj8sUs2rlU3vUl9jP4zoog== X-Received: by 2002:a7b:c319:0:b0:434:f586:7520 with SMTP id 5b1f17b1804b1-43924a27e47mr132662305e9.6.1739208061666; Mon, 10 Feb 2025 09:21:01 -0800 (PST) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4390da70fbesm188607735e9.24.2025.02.10.09.21.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Feb 2025 09:21:00 -0800 (PST) Date: Mon, 10 Feb 2025 17:20:59 +0000 From: David Laight To: Steven Rostedt Cc: Joel Fernandes , Prakash Sangappa , Peter Zijlstra , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, Thomas Gleixner , Ankur Arora , Linus Torvalds , linux-mm@kvack.org, x86@kernel.org, Andrew Morton , luto@kernel.org, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.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 , Konrad Wilk , jgross@suse.com, Andrew.Cooper3@citrix.com, Vineeth Pillai , Suleiman Souhlal , Ingo Molnar , Mathieu Desnoyers , Clark Williams , bigeasy@linutronix.de, daniel.wagner@suse.com, Joseph Salisbury , broonie@gmail.com Subject: Re: [RFC][PATCH 1/2] sched: Extended scheduler time slice Message-ID: <20250210172059.07cda916@pumpkin> In-Reply-To: <20250206083039.0916ad24@gandalf.local.home> References: <9DA1FAE6-A008-4785-BDF9-541457E29807@joelfernandes.org> <20250204220418.35949317@gandalf.local.home> <20250205081635.397eacb0@gandalf.local.home> <20250206083039.0916ad24@gandalf.local.home> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Queue-Id: C1A6F180008 X-Stat-Signature: 9g4gb1tzwkhohp5fbiuofet1czmigdpz X-Rspamd-Server: rspam03 X-HE-Tag: 1739208063-125292 X-HE-Meta: U2FsdGVkX1/dRH5Oqcik8hsG7l5TVKxyZDNUgDl6H+umHke3S1S56Bta4O3aGErzvQCCXCa4axI0bfQqG6CpHHpjMpzausDFLynUvXUTsiqAb+g32a4o2tnkTdlWBeEM2nEWsR40AG9xbEkDO6XINyrQNXxwLcEyQ/NtA8qCpy0tw/KIg1+O7Qg2NYhTMdZQBTUIhIYq9rmdtdxM5gfi9LQqPsYyxNT43zpGnDqkA9++wJDOdf0mQE+q4qKlaGmkf8+KVATqsQA4X4ryutmGx3MwcYiRLUc/LY/BFnhQNt75EyuRgyllE+CZZ4nSpqFNd9qSSUqTTUAsvOLcEEHv72e7C7FbWpoI6HVyNQFzSPVlxtRnEr7b3B8RHsqs4fJdpoy1RlvTGolXrWZ9/93WdQRNu6sFnBqRStfR8nGbmsEWNH27sfpQqBX8l1+6jCN4g+a8DEslZ99p6B5U7fa8mk1C0PJYab+X5yI4cfBvVAkXJC5frT6AGuY78Rxjm4zoynMWQLWm/NZQdoiiu9msiogv+3lPm3Hr5Va/fr0hPSYUlZvzNj6eAPhVP72vR/o2GSJOlu5TNtx7XeX9prJbLOCHTZj9C71ubYz39cB9pFuwFGhIqlJUTVPpu7YIErWzdFi2cTl/fdyyFmjPAjf6I93bAcXN7BN+HpVlt3OSNEI86LK4OAC7ssr4EiNpjtOK/CWoSF6Tol1ZOmq/Kb1oxCL1YsfMvq25xnE0hOAp65RBzlza2Gl1Q+FSPgyKknKz0FaoshqojPX0n464eFsEvbIwW43eEiaq1oqojMw6PbuIB25jzYchK5ek6u52kYRNqNrNikvpoeg4D6pDR1ZMML535BjjU9lply2RnMeJUdDuzHDlBksxiPBaGL7Ap/UOvHM6M6Qi6hzYdUks7i9o2e1YMFVbOkdeU6ogDcdJif+CKv2iVVWXVKPlx/nbJqidb0soGAKktN65JUQMdDS j1qZl1ju z01yvZYg5wgKgm8UrMM10/bE1XroVklz9eElratARJEIkHqhEDeIM/5awKa+akisiR+qlSWFAuoYeriVcV9230G4JDTsU1f924DpHGu9rNzolugOqxvN7tVXV17GrCoIDzaBA66bQ8Sci3pI1RFViP3beTCdPn17JRse05qxb5G9h/xS3/xMxU7aeELYHEEXuHNoVyrW6celSLyL/yO0l9Vj1tV+pjM4FXTwHYyFjQZNuv/tIpc3lpnwqKdwwXAULv2LU9+tQ/VvhEzluT+xY2Opt6lE7M9YNd1c4mc/xrUUdvBejrpiE0hrpQdcpzoLQhRRIBtvr8z16PcKM0gxhW6nRuRGlQoq8ryWC0RuUDVuTr6905+BC4qjlrmyLnxkK388Q7zwpitbHoxT/gn2nHypE9D9uxRR9Q+1vQsWUwjvQEcIVBJzGeRWjiRmwNZM0b+Fdr3CzQXA5KSjjCju6nVsKZHj0wtC0WSK70Y4F9YAVoe1sYcHW5XujV5dEKd4O+flYdkFBVFlzSZWwiLC6fimCPGhuejAvMJPsdZ/YJoYKZUBFh1UzlnaWzBB+9R6ktjrYbN+xblGAM/k= 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 Thu, 6 Feb 2025 08:30:39 -0500 Steven Rostedt wrote: > On Wed, 5 Feb 2025 22:07:12 -0500 > Joel Fernandes wrote: > > > > > > RT tasks don't have a time slice. They are affected by events. An external > > > interrupt coming in, or a timer going off that states something is > > > happening. Perhaps we could use this for SCHED_RR or maybe even > > > SCHED_DEADLINE, as those do have time slices. > > > > > > But if it does get used, it should only be used when the task being > > > scheduled is the same SCHED_RR priority, or if SCHED_DEADLINE will not fail > > > its guarantees. > > > > > > > Right, it would apply still to RR/DL though... > > But it would have to guarantee that the RR it is delaying is of the same > priority, and that delaying the DL is not going to cause something to miss > its deadline. > > > > > > > In any case, if you want this to only work on FAIR tasks and not RT > > > > tasks, why is that only possible to do with rseq() + LAZY preemption > > > > and not Prakash's new API + all preemption modes? > > > > > > > > Also you can just ignore RT tasks (not that I'm saying that's a good > > > > idea but..) in taskshrd_delay_resched() in that patch if you ever > > > > wanted to do that. > > > > > > > > I just feel the RT latency thing is a non-issue AFAICS. > > > > > > Have you worked on any RT projects before? > > > > Heh.. I think maybe you misunderstood my statement, I was mentioning > > that I felt (similar to Peter I think) that NOT adopting this feature > > generically for all tasks due to a concern of 50us latency maybe does > > not make sense since poorly designed app / random hardware already > > have this issue. I think the main concern discussed in this thread is > > (and please CMIIW): > > We have code that has sub 100us latency and less. If some random user space > application applies this, adding 50us (or even 20us) will break these. And > this has nothing to do with poorly designed applications or hardware. > > By adding this as a feature that works everywhere, you will break use cases > that work today. Hmmm... you lose big-time anyway. All you need is a lot of network traffic 'pinch' the process context until the hardware interrupt, NAPI softint code and rcu softint code completes. That can easily take several milliseconds. We managed to get a trace of a SCHED_FIFO task being pre-empted by a higher priority SCHED_FIFO task. The chosen target cpu was active running a worker thread. That got interrupted and ran softint code for several milliseconds. Other cpu became idle, but the scheduler rather expects to be able to run RT threads on the cpu it chooses. The same can happen if an RT thread grabs a mutex for a short time. All it takes is a hardware interrupt and the mutex hold time goes through the roof. You don't need a context switch to hurt you. The only userspace fix is to replace all the mutex with atomic operations. (And even they can be griefsome because they are measurable slow.) David