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 14303C4332F for ; Mon, 30 Oct 2023 18:39:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 820956B0278; Mon, 30 Oct 2023 14:39:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7D0C66B0282; Mon, 30 Oct 2023 14:39:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6BFCB6B0283; Mon, 30 Oct 2023 14:39:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 5BC4A6B0278 for ; Mon, 30 Oct 2023 14:39:15 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 2C17EB5BE5 for ; Mon, 30 Oct 2023 18:39:15 +0000 (UTC) X-FDA: 81402990270.21.834584E Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf14.hostedemail.com (Postfix) with ESMTP id 3CBE5100002 for ; Mon, 30 Oct 2023 18:39:12 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf14.hostedemail.com: domain of "SRS0=hW9q=GM=goodmis.org=rostedt@kernel.org" designates 145.40.68.75 as permitted sender) smtp.mailfrom="SRS0=hW9q=GM=goodmis.org=rostedt@kernel.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1698691152; 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=cJjvyES9E8oIPzlETnBBtpACNr98f7urydAMQ6fMhj4=; b=z9+pxGb92xKZ33Gk5XmmqJX3r9m3+zhXTA+owMCxxTREmqCFrZFRYaVqvxE7TkneBGb9qW JWXJ8y2SclyIV20pio0rF/n67lXB4lLDRFZV4MCEd35WuzkHduSnjR4lXqWLzH4+JFjtrE xZ1V8tStFRERFNRLrPVFzC5lk0UzOFY= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf14.hostedemail.com: domain of "SRS0=hW9q=GM=goodmis.org=rostedt@kernel.org" designates 145.40.68.75 as permitted sender) smtp.mailfrom="SRS0=hW9q=GM=goodmis.org=rostedt@kernel.org" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1698691152; a=rsa-sha256; cv=none; b=U2EuO3qoaRTsucOBYMghriqriugeQh+xqm+ILrV0XzG8WyWX0nPaNmodERX/yd6b2M9SfR u+ivhE1qCdAgwCbtTvq7sXnMxXtc1rMU92CmbsPznY0Nko/g8YlHJKkbsNhaEty/kYK7z2 ZhgrAUZ6bMyudaDu64R7qUgzzKhkqM0= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 0D3ACB8094D; Mon, 30 Oct 2023 18:39:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5F8C9C433C7; Mon, 30 Oct 2023 18:39:06 +0000 (UTC) Date: Mon, 30 Oct 2023 14:39:04 -0400 From: Steven Rostedt To: Mathieu Desnoyers Cc: Linus Torvalds , Peter Zijlstra , LKML , Thomas Gleixner , Ankur Arora , 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 v2] sched: Extended Scheduler Time Slice Message-ID: <20231030143904.5db873b9@gandalf.local.home> In-Reply-To: References: <20231025235413.597287e1@gandalf.local.home> <20231026105944.GJ33965@noisy.programming.kicks-ass.net> <20231026071413.4ed47b0e@gandalf.local.home> <7871472b-a0c4-4475-9671-69a3244f956d@efficios.com> <20231026164549.14d45c60@gandalf.local.home> <644da047-2f7a-4d55-a339-f2dc28d2c852@efficios.com> <20231027122442.5c76dd62@gandalf.local.home> <20231027124930.3753cdd4@gandalf.local.home> <20231030094508.031357b4@gandalf.local.home> <20231030141956.05661b90@gandalf.local.home> X-Mailer: Claws Mail 3.19.1 (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-Rspamd-Queue-Id: 3CBE5100002 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: r8op8ndp536okusp6asoat8d85asanka X-HE-Tag: 1698691152-646259 X-HE-Meta: U2FsdGVkX18eVp67oVIiIW9SV7JNDljrW8CpYjsrqRtZTl7H/UbW8gzzlSgLtfcUDred5eyuP23QrG6YrDfJzcECQeFesk4FESsRGx8zXoNggIpSoIkxjjnjkKYBiVIbWgYqtgTZTWl9IALEqO5LJkgVoYjL5zQD/ckq09Mk1+/z+aqNW4iPmIJ2q+CIaxu87tmikVRd0ku8pMZhd4nmL2Flao4KlKhVogh5vrg5TjaCEVnei99MDS/PgOC+4Gz2W0h79HOvnz6zZrZqAA4Kg6KBI0y5wsclzx54MjD2yOj5bpL2QICBpH09LG5XxF/o4PYoL0Syhs8vAey9j2pKMPj8Jv9rszUgKCdubI2YRAnkatOUpz4m0BH2RnPjR2wmJgS6HQyRdiD7bdBq13m51wIS3MVPRiLtzoQ4jyRzZqU8byzT0JI60nvBxsFk1TkkPy2KJinm7nDeQe4cwnNvPRkEjEdPLYzDevRlnxDGkkBJMSdx5ecvfAC7btwTMa83qYFphTHjS998DrinJLJ7AY7Gj8u6HCm5LUT6cK8u75P4YoGRoTTNIykWRj/+mHdnuJ9YgLfpMwgRmW14yTXWWTNvCvVqB6zfqP4mjf+U0Otio1K0aTZdMOaQVZOZKvRIJiuHD5Tn3PmQSCNNX5BYB6ftzJrl02AYyWXX0DtS3YSd2AQrsk38fy1KuBs4Z8a6z+VkQ2Dv3IKPSHT+C7u+wCagcKkuPpmetCSEFga3R7J9Cnf9V12ghMKbQD3x0qUSLgxXJCBJqHDpT2+WXwUI1AU54S46t1BoSKF+hfg51dta0nxHzyYidnlOojV9GhhTtglepKqRjlXSMbOj3nndVbaLlHuyEas5783yrzHj6T6832qmxey9FIna99edY02LWnJEXZ1om6RqDzkzE+zYCLoz4hPBLvQyhi40rsMrS3o/ednxRv8SsP6eMELYjNaNJBkLk+ebQhRRtyNbZav 72lkNgfc /g/SlOnoUvLTEJz9H7m/SLHt09917Lq+B+ybnQbzR+PUmEXWDQgaafJKYTIjt2aM0YKlAlnJvOqGIBB36yiNEqRgtvPIrfrS0sM5509LNElLwmrX+p4cbTxWRM+0fxz4+EcSpY6VKvnVnamU2UyW36Xp2qJx6HyEwM3eSr+5qt4SEoCBVWg1PyKdPd7z17AgVzXGZdEYVWKSTuOT/zmyxTGzd58grsCotEf0mgsS+DmWnci7kxoKceEX5tJXvXPa7ir94/OhzjChHCPQtWP0cBakeAg35tEd/Ye1aF2Qw9SBd1Ri175+FB3lgqQ== 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, 30 Oct 2023 14:27:10 -0400 Mathieu Desnoyers wrote: > > So I just made every unlock disable the extended time slot. I need to go > > back and enable both a counter and an on/off as I now realize that the spin > > locks (called within the lwlock) will disable the extend time before the > > lwlock is released. This should work if I have the spinlocks inc and dec > > (they are straight forward and all locks are associated with an easily > > found unlock), and have the lwlock use bit 31 as an on/off switch. > > This extra on/off switch appears to be working around userspace issues. Yep! But that doesn't mean there's not a legitimate use case for it. I don't want to limit the feature for that. It's unlikely bit 31 would ever be hit by a counter anyway, for which it could be used as an on/off switch the same way the NEED_RESCHED bit is used as an on/off switch for preempt_count in the kernel. > > > Anyway, I would let user space decide what it wants to do, and giving it 31 > > bits to say "I'm extended" and let user space come up with how it handles > > those 31 bits. > > If this makes it into the RSEQ uapi, RSEQ should state how userspace > should collaborate wrt those bits (e.g. nesting counter protocol), even > though it's not a kernel ABI per se. Otherwise we'll just push this to > libc to specify this, which is odd. I agree that user space should have the usage specified. Hell, that bit could just be used for testing purposes. I think having it reserved is a good thing than not specifying it and limiting its usage later. -- Steve