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 DA957C021A7 for ; Wed, 12 Feb 2025 15:00:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2EF0E6B0082; Wed, 12 Feb 2025 10:00:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 29E5C6B0083; Wed, 12 Feb 2025 10:00:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 18DC06B0085; Wed, 12 Feb 2025 10:00:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id F08F66B0082 for ; Wed, 12 Feb 2025 10:00:00 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 8BCB91A1FB2 for ; Wed, 12 Feb 2025 15:00:00 +0000 (UTC) X-FDA: 83111602560.30.1AD1A0F Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf16.hostedemail.com (Postfix) with ESMTP id C2103180012 for ; Wed, 12 Feb 2025 14:59:58 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf16.hostedemail.com: domain of "SRS0=d9zQ=VD=goodmis.org=rostedt@kernel.org" designates 147.75.193.91 as permitted sender) smtp.mailfrom="SRS0=d9zQ=VD=goodmis.org=rostedt@kernel.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1739372398; 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=sHepOKE1UB8aoyBs2bU6yVQg15CEPKbiko/Z40GVBb8=; b=oWh/5Kcb/84XBF1PfpI7wnyS81Bu4N2BjU/ffCaBYh2BW9lX5MDzihK62Winl1CFrq4B3Q ui2wEianjC8ux/TIDEWO/hSX+SbstiMmBYB6anH7MeCpbao0ERAKAyYUvdqpvyOtaR+JZO nX2iH8yfCPX0DuB5N7MtmnYT+/js4ok= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1739372398; a=rsa-sha256; cv=none; b=PXjH38aNCGA9BOXzITGkox3vlD7n+9AMEFOQxao/HiQILMk7Suf32j0VUUs+uS6FZY0TpI 01IZ+bX2oiAthpRLPO2SgTo3z5pvUqx2yBfpOZaWFl3wd+YTvNI04UJFIQSTSlJJkzFglb 8M7yQaBOSS5L3r7dehht/tCea/Gser4= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf16.hostedemail.com: domain of "SRS0=d9zQ=VD=goodmis.org=rostedt@kernel.org" designates 147.75.193.91 as permitted sender) smtp.mailfrom="SRS0=d9zQ=VD=goodmis.org=rostedt@kernel.org" Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 801C2A40185; Wed, 12 Feb 2025 14:58:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F070BC4CEDF; Wed, 12 Feb 2025 14:59:53 +0000 (UTC) Date: Wed, 12 Feb 2025 10:00:01 -0500 From: Steven Rostedt To: Sebastian Andrzej Siewior 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 , daniel.wagner@suse.com, Joseph Salisbury , broonie@gmail.com Subject: Re: [RFC][PATCH 1/2] sched: Extended scheduler time slice Message-ID: <20250212100001.2e129b62@gandalf.local.home> In-Reply-To: <20250212121113.3nJ-kf-6@linutronix.de> References: <9DA1FAE6-A008-4785-BDF9-541457E29807@joelfernandes.org> <20250204220418.35949317@gandalf.local.home> <20250205081635.397eacb0@gandalf.local.home> <20250206083039.0916ad24@gandalf.local.home> <20250206134408.lD_POjuG@linutronix.de> <20250210144321.1f5974a6@gandalf.local.home> <20250211082138.iqvedSfG@linutronix.de> <20250211102801.5b32d610@gandalf.local.home> <20250212121113.3nJ-kf-6@linutronix.de> 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=US-ASCII Content-Transfer-Encoding: 7bit X-Rspam-User: X-Rspamd-Queue-Id: C2103180012 X-Rspamd-Server: rspam07 X-Stat-Signature: rabjn5ps9qrj5fsjbs8xr7tgjtwucgjg X-HE-Tag: 1739372398-726863 X-HE-Meta: U2FsdGVkX1+RHg2rnRa+PZ8JgI0J8tdDn04Qtu+NBzfH8ZXRoo0wojcHP9SBL3j7tl2YejFimXH0Zz6GPuhMSNEvA8qIxAz8JoAmPPy46I6jx9EJH9qfaezQmAxLU1GGy0+//chLFqUsu+LzUYKFvjygRRWn/WlMnKE50Y2hKeXBkS8RG+MKCsb/20Hx+2qzNz9cTCEghuaSimlVizk3hSGtOgXsVDMz6roV25sI3QyTlIvs3wO4pwWBg4X+EqdhQqBkQPVT+HpTbLCXCa/KQVduudR/EoYTzxKdaCzL/nyIJu+wR5AkBtqtMphXgoDyghYmG8xUgfNW4kDd9+8lK1nGc7pQNiiKImURbkm/rcNIqia8KBE43pFUMSikROzZY250evM+Is653VhpFx2eFY1XMO7xeXWG91vCjHChdVUjevRV1Eb/wodx97s3hxZcqf2iitQrPLC3ufg9iXQQxUoHTVVgakqT1UZqsCtU6mCr5zlG0WL5HPGv6mbCr07e0vNK9cUNiZIOnhjQGoAa2BzNJIWFSgJJVXOmrbE60Z6sZWINR4mOPTyHit+VnYccYnP+4AFwPr1CE9Sz9T+Z1hSl79CmAzUl5tvv7WmZhmD4FbRD9oDfKG2VjYBsjVmX93V55ti7G2fAo6Sge/eex5h+PMOc56dX+VP/KcVPWyEloqFpCFS0sSsmNBOCZtVo54jJsfV1PxZqeZ36mxazYN9CMB/C2IYOUGUHCyIjvR8Elt5jb2GcVNR3R2jm88qv5Duvr7rPZICYEQd1JusH3Re86yM9CEHN3M8bWyRONiCg/Bs9Tg+JVgcNs09SOewAtuervo2ZeevjHxTY7P2GWQLntbi10qRMgFAi4b7fPlg24jEKXkqMmZWn2G1rOtpvuX3oW9meC7yHP4m4dJrqUemmTQOS4LA09Rqxun+SWIiXGTgXaz10iXpMWz7iV7csxF58oQdX+WcT4F4kxP7 E6CgJkc2 1E7Y88osLzCl/QenDP+mgj/BL+fp1BYEw9Nt+EADkWIwKFMStLSSRSidf9ABKDBvsPj8stM1GsrhlG3/4ggDSwgcZ5j6Vtlzsb2wvis5cIaXl1BSSTxzYLWAO4UHDIEw8myt+znRruKFxnnuxmOvMC9BKGySVXZjKDyZo4fg2QW4F0j8Royy9yXnQXqc0ZjWBS0UUsUnoBanmmyv/wBMFwEIjAP+q6xJsOR69pF7Hz2TovEYgEFzl5S/r5Vi7Db3W/waM1nEjcm5ZN8ZfIyECkQDV2WMzKr0OyhCOwzigB8dQy6tdhpFYACJ3ITxRfjTx9hjn 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, 12 Feb 2025 13:11:13 +0100 Sebastian Andrzej Siewior wrote: > > IIUC, today, LAZY causes all SCHED_OTHER tasks to act more like > > PREEMPT_NONE. Is that correct? > > Well. First sched-tick will set the LAZY bit, the second sched-tick > forces a resched. > On PREEMPT_NONE the sched-tick would be set NEED_RESCHED while nothing > will force a resched until the task decides to do schedule() on its own. > So it is slightly different for kernel threads. Except that it should schedule on a cond_resched() and the point of adding LAZY was to get rid of all the cond_resched() which in turn gets rid of the need for PREEMPT_NONE. Which was what I was getting at. That PREEMPT_LAZY is really just NONE without the need to sprinkle cond_resched() all over the kernel. Instead of having cond_resched(), we just wait for the next tick. > > Unless we talk about userland, here we would have a resched on the > return to userland after the sched-tick LAZY or NONE does not matter. > > > Now that the PREEMPT_RT is not one of the preemption selections, when you > > select PREEMPT_RT, you can pick between CONFIG_PREEMPT and > > CONFIG_PREEMPT_LAZY. Where CONFIG_PREEMPT will preempt the kernel at the > > scheduler tick if preemption is enabled and CONFIG_PREEMPT_LAZY will > > not preempt the kernel on a scheduler tick and wait for exit to user space. > > This is not specific to RT but FULL vs LAZY. But yes. However the second Not true. PREEMPT_RT use to enable PREEMPT_FULL as well (it would preempt everywhere). The issue we found was that spin_locks which would not have been preempted by just FULL alone were being preempted when RT was enabled. That caused a lot more contention with spin locks in the kernel. That is PREEMPT_RT with PREEMPT_FULL will have a noticeable performance degradation compared to just PREEMPT_FULL alone. > sched-tick will force preemption point even without the > exit-to-userland. > My question still stands. Have you compared PREEMPT_FULL with and without PREEMPT_RT? -- Steve