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 B8160C02198 for ; Mon, 10 Feb 2025 19:48:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 45987280013; Mon, 10 Feb 2025 14:48:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 40CBE28000B; Mon, 10 Feb 2025 14:48:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2662D280013; Mon, 10 Feb 2025 14:48:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 07A3228000B for ; Mon, 10 Feb 2025 14:48:33 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id B4D38A0591 for ; Mon, 10 Feb 2025 19:48:32 +0000 (UTC) X-FDA: 83105072064.16.818A0B2 Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf14.hostedemail.com (Postfix) with ESMTP id 0C0F310000E for ; Mon, 10 Feb 2025 19:48:30 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=none; spf=pass (imf14.hostedemail.com: domain of "SRS0=vbKj=VB=goodmis.org=rostedt@kernel.org" designates 147.75.193.91 as permitted sender) smtp.mailfrom="SRS0=vbKj=VB=goodmis.org=rostedt@kernel.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1739216911; 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; bh=9JQppBolT9hzFpOdXAQC59/2zLX0t3e5aPQV0gnWttM=; b=pJpZ+QN18SwxaCMP/eiMqUFOjIdOz+Wio6ddtTFHYbm2G1uKp09Is5tcLEydZSN5AFZ/o1 9B/cdF/Xdj8c4QmYk+zBYdIYc4j8mx0YAgB56BODnkfg5AA5hbl2n5zZ/+RyUp0UVKYykO 2BHVFwQ7UCdyFotGHKwG3cbyOZuSDuA= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=none; spf=pass (imf14.hostedemail.com: domain of "SRS0=vbKj=VB=goodmis.org=rostedt@kernel.org" designates 147.75.193.91 as permitted sender) smtp.mailfrom="SRS0=vbKj=VB=goodmis.org=rostedt@kernel.org"; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1739216911; a=rsa-sha256; cv=none; b=xRn9t2KPdEOnw0v7oDsInxtE0IoUkU4TjQphQfNGHgwYF4Qdtt3PMtu1eB6XGixaAy4luX mhySI+qlqjubk8ElEZveOI8Y4GKqKmIKIzZu28JJuVMpf8XhQppGvmlAKnvUl1lU4lFkuT 2dtvG97fo6QIrSSxUAvIVncmPW8vd4E= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id CB758A4210F; Mon, 10 Feb 2025 19:46:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7EEAFC4CEE4; Mon, 10 Feb 2025 19:48:26 +0000 (UTC) Date: Mon, 10 Feb 2025 14:48:29 -0500 From: Steven Rostedt To: Joel Fernandes Cc: 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: <20250210144829.02e66f44@gandalf.local.home> In-Reply-To: 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 3.20.0git84 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 0C0F310000E X-Stat-Signature: 7m1efc6n7637x9gocpjj659f31kjozt3 X-HE-Tag: 1739216910-873293 X-HE-Meta: U2FsdGVkX1+6AatCxJ13fRBnfyuhMOPOewn74Loj8zoXiYqaMx9NXOcc0tWtXSA8HwoMN553V90s1iQOqx3wFL6Gh7gzy5yGkcu6NtppIyRODMF84x+0sJj2czKgNg0Vrxsu4SfdKtJIgIqJqL4Bn5u4eW6tYuqJgaj7baB/CUxZnBJHrSDwKD50A/Agvi8LEhZA6RlLZS6rj0LP9eu0IZ4o09YtjTZ99yT8GkQz0gbuzQBgpRINyo2TMxbuh8ux+zSl068jZ42wLGrVtO5QMZ4QDulY6pWT8nhAlIByxzZJYUIreOdOhZ+WfQVh2L4FqX1eOP0Iu0pqE+E9+PSxpHtPu/XYry3R0OlMMhKSdnY+FZSMOw+AKrBkGILS7NJ70iSZ7XiJWj6w3QqPLzrjVXtj7nqQQmRueB/2I3mJZre9pfEWaSwPhCE8uQizVkIRQYLHdtWXTCyBBkEJGG7vILx/VM0gSEZCl9tOZaRKR5xNavo51P0BLCyAfG1enlDgbiViA2DapsA1ZiYJkVJrO1626OYYtoYxz33NHWkSLVaOI61gq0xK6GgGYr/Atfy7ugcbPr6CMpWtoRPryPldj5OrYjg55CfCE2yS+rXUfXgz+u/wRN3mk1hn5qpA/Cr7p3o6VgfoHHBul6Hu7DxCvzmwJJHKxJ7RfSiWONrdKyiQYNUBJqZMSeAWC2umSEU5THVlUybQ2BCqnpvU3G9IynPU0ttoZGZMWEdSAS1EGCrCaqpNqtDh+WB+iHHr3ZfLjic2FV4wBGAlTZv2SpbFNhDb0ae5V4mEKkeYtzFBcet+kNFHeXxQ55+5IufUbMeWv/uwAG/KCrGihHbwYrwOAololJ1GgfBiaY1ePPMRBqDu5JXxsQxnKwAx45odJlVjiTLs3jJfViiIrI29mCgYi7Y65q/KQOkMWoY0kM9gU7+2X7AIdRkHE5RAaeAnqokkD1h1dQOK8C2JAXXedMK YYILp7HC f9Fjgomn9dI+1L9PChbIcvhItImaEQnPTqaf3/nsbKw/qgOmwiNwEa1XKYNoKp1L3tfl51eF2SIP2E9MuKbfXWmD9cmKGlWWax98XfZIcdB7Fypq6yMKvbYkH0YZd7sz5EeKNXfrmuSwry18C2GbtI3h1S3svAvX3ph5npvxbRXHyhc7eLBKamV6jb498cz0UX9m7AA9s+fiENK44HborO8LswlBTZipMDfRZ4vs+rXPN3YEN9v/2SJGTEK6To2yM+uxC7klRSzSLCqe/vxtzO6Qw93UrIJog1/i7iBPE7z0G+CGW2aTZ1oKO5R/ZClPVLJQnzkaHEGJTPpM1a2CmaIZNBYO3f/uDz21+Zpc2LjBQ213Y9LN8LJZqeGkfv8UpVkDPLmZXTiUwYW930sL/7q9vO/6XN/59QvdChSba0CieaHhoM1BPIdbebA== 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 Mon, 10 Feb 2025 09:07:27 -0500 Joel Fernandes wrote: > On Thu, Feb 6, 2025 at 8:30=E2=80=AFAM Steven Rostedt wrote: > > > > On Wed, 5 Feb 2025 22:07:12 -0500 > > Joel Fernandes wrote: =20 > > > > > > > > RT tasks don't have a time slice. They are affected by events. An e= xternal > > > > 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. > > > > =20 > > > > > > Right, it would apply still to RR/DL though... =20 > > > > 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 m= iss > > its deadline. =20 >=20 > See Peter comment: "Then pick another number; RT too has a max > scheduling latency number (on some random hardware). If you stay below > that, all is fine.". See mine and Sebastion's reply. Just adding another interrupt turn around, and you already lost. > > You see, LAZY was *created* for this purpose. Of letting the scheduler = know > > that the running task is in a critical section and the timer tick should > > not preempt a SCHED_OTHER task. > > I just wanted to extend this to SCHED_OTHER in user space too. =20 >=20 > Currently it does not "let anyone know" it is running in a critical > section though. Various paths (update_curr(), wake up) just do a > 'lazy' resched until the timer tick has elapsed, or the task returns > to usermode/idle at which point schedule() is called. And it does this > only for FAIR tasks. That can well happen even if the currently > running task is not in a critical section in the kernel at all. Sure, > it may benefit critical sections in the upstream kernel but where is > that explicit? I still feel we should not overload this in-kernel > mechanism for userspace locking and complicate things. That's nice that you don't feel it. But I do. ;-) >=20 > > > Yes, I have worked on RT projects before -- you would know better > > > than anyone. :-D. But admittedly, I haven't got to work much with > > > PREEMPT_RT systems. =20 > > > > Just using RT policy to improve performance is not an RT project. I'm > > talking about projects that if you miss a deadline things crash. Where = the > > project works very hard to make sure everything works as intended. =20 >=20 > No no no, I have done way more than applying just the RT policy. So > that means you do not know me that well;-).. I have worked on audio > driver latency, low latency audio, latency issues in vmalloc code, > preempt tracers, irq tracepoints , wake up latency tracers and various > scheduler overhead debug =E2=80=94 many of those issues dealt with sub > millisecond latency.. I also dealt with cpu idle issues in the > hardware causing real time latency problems (see my past talks if > interested). I was partly a hardware engineer when I started my > career and have built circuits. I have Electronics and Computer > engineering degrees. None of that sounds to me like an RT project. I'm talking about robotics, industrial machines, autonomous driving, power plants, etc. Where everything is measured in WCET. -- Steve