Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2580499rda; Wed, 25 Oct 2023 06:56:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEW1dexEN154gX8o4x2hWA1K94X3zejvFFhC3J6zMGWuag5WXEs/+GtVVEKo/rg9n4hujt/ X-Received: by 2002:a25:5007:0:b0:d9c:7c97:7fcd with SMTP id e7-20020a255007000000b00d9c7c977fcdmr13509849ybb.27.1698242214963; Wed, 25 Oct 2023 06:56:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698242214; cv=none; d=google.com; s=arc-20160816; b=asx0Yd1b9JZOLYDQY1lfMo2OX/InJjcR5fNEhUGH/ihFbcY6HiExTP1nkgdM8ONs/T f+mE7ewFUIsOJUOZm+eDDUT1Gw6+k+hk1i4xtmpmxNb3YY8pPKltUigzV57rxDKrF1s0 SjuUVJtyXE4VFGed523JvDIbGKdITrADFBaAfOR+Ou+Q2VqzQXIPfd+dPaOR51PopWfW PQ/uudkrYD9nuZ6UE3Ken1eLCRRe0CpdnXmRlGG4jj1SJALyoA+2cmXvY3jy9S4trL8W 20VpTHcgRlgtbyHoehhNkq3NH+HPRhIcY1Ln2lvIoaRhjcTd9taRXPPldk9rkyF0sH5D bDkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=pdPNIyANO+IrtJhwgqRTlWVT66WVymm6d1ZLZ8No5pU=; fh=FryJ+Cl2P61LIIM/MNyzvWcZ5L0h8ToncgB7RUjeEPw=; b=hFbpvfXHZFkQ1tSmf0OXfXo0Xx3CSiRQG61lGRgLj3tQU9tdRZKQgk9okPmhZMErLc CJDeUkdZOTu/iGFRUrFAcpcUibv/PXWymdsCtBZhW+3KjLOM+wIDLXMKzpBl8szRF0ew MRy9b7587Wldx3xsfzfVfb4Q2imr5w9Twdbeev3rSTpEAYEhS4s6g0IkgyhK5Y3zuTQ5 O9EnMoVlXlkNuSRnL0+xV/9SagUPJ6+652JU/81nZ6s0BF28+ioWfxLEA32OltW1zmsP hdsbeorfaVypMJzwjBXVt6rNwVtGDzfC15WDcUXme+ebvj5oM1dWhdwRCXzKcsY03oBb 7T7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=aC4u6wbb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id t2-20020a254602000000b00d85215d6519si9332034yba.595.2023.10.25.06.56.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 06:56:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=aC4u6wbb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id A79F58108350; Wed, 25 Oct 2023 06:56:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344545AbjJYN4d (ORCPT + 99 others); Wed, 25 Oct 2023 09:56:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344519AbjJYN4b (ORCPT ); Wed, 25 Oct 2023 09:56:31 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FAF6194 for ; Wed, 25 Oct 2023 06:56:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=pdPNIyANO+IrtJhwgqRTlWVT66WVymm6d1ZLZ8No5pU=; b=aC4u6wbbvkQWIu9A2bWwLTxi8K jDQLhhmdQd8BTiGEsdp/IAULoyEEnpDcrxV7HneAFou72KYGNKxBQ8Yc/XHDvyaKkNb6McWVn8Jxf AthweahAtCTx0fMgd35KJZJ51fkwxKyDOdPtyFycMlVFiQMzdjxkIHrK7+f9tciuPEZ4J4ICFmZR0 Jxun1pR8dWgF49nfwTlLwG9ugsAKkVhmerleZxUPI7Rzl203d815oV9jpgRYEs+767PbFC/IIPLPC VUXA2XOdQHCWE9dxAZygi6xHLykhYleF5dsvN7PgadhTAhd8YTFMSJsW9J8unChgiQFc5VUXghTIW gAEm4lSA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1qveMM-0097TQ-5k; Wed, 25 Oct 2023 13:55:46 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id CE67B30047C; Wed, 25 Oct 2023 15:55:45 +0200 (CEST) Date: Wed, 25 Oct 2023 15:55:45 +0200 From: Peter Zijlstra To: Steven Rostedt Cc: 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: <20231025135545.GG31201@noisy.programming.kicks-ass.net> References: <20231025054219.1acaa3dd@gandalf.local.home> <20231025102952.GG37471@noisy.programming.kicks-ass.net> <20231025085434.35d5f9e0@gandalf.local.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231025085434.35d5f9e0@gandalf.local.home> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 25 Oct 2023 06:56:49 -0700 (PDT) On Wed, Oct 25, 2023 at 08:54:34AM -0400, Steven Rostedt wrote: > I didn't want to overload that for something completely different. This is > not a "restartable sequence". Your hack is arguably worse. At least rseq already exists and most threads will already have it set up if you have a recent enough glibc. > > So what if it doesn't ? Can we kill it for not playing nice ? > > No, it's no different than a system call running for a long time. You could Then why ask for it? What's the point. Also, did you define sched_yield() semantics for OTHER to something useful? Because if you didn't you just invoked UB :-) We could be setting your pets on fire. > set this bit and leave it there for as long as you want, and it should not > affect anything. It would affect the worst case interference terms of the system at the very least. > If you look at what Thomas's PREEMPT_AUTO.patch I know what it does, it also means your thing doesn't work the moment you set things up to have the old full-preempt semantics back. It doesn't work in the presence of RT/DL tasks, etc.. More importantly, it doesn't work for RT/DL tasks, so having the bit set and not having OTHER policy is an error. Do you want an interface that randomly doesn't work ? > We could possibly make it adjustable. Tunables are not a good thing. > The reason I've been told over the last few decades of why people implement > 100% user space spin locks is because the overhead of going int the kernel > is way too high. Over the last few decades that has been a blatant falsehood. At some point (right before the whole meltdown trainwreck) amluto had syscall overhead down to less than 150 cycles. Then of course meltdown happened and it all went to shit. But even today (on good hardware or with mitigations=off): gettid-1m: 179,650,423 cycles xadd-1m: 23,036,564 cycles syscall is the cost of roughly 8 atomic ops. More expensive, sure. But not insanely so. I've seen atomic ops go up to >1000 cycles if you contend them hard enough.