Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp351206rdh; Thu, 26 Oct 2023 04:14:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHZeFtMBDEHY1HLxjuy8lSTPqW3DHx5exJe9g7ZqktbfPV/IosSbGkBHPSliYOvQXdYOiv/ X-Received: by 2002:a81:4e09:0:b0:5a7:c50e:8df with SMTP id c9-20020a814e09000000b005a7c50e08dfmr20748729ywb.18.1698318873460; Thu, 26 Oct 2023 04:14:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698318873; cv=none; d=google.com; s=arc-20160816; b=HL51LoCv5Z0aH6ZmAEB2+cmmnu43ngNH0OMgx5eQStwopaABEpl2xEvlB+A4IMZfnQ a9ZVHqIAfh8M7fCQ3Cqx7CmxAUMmYT/QW6jELnxUsdcyN1+ufGarF2yGx7V49issJaru veqh0EtIGHrT4Emquqq9Yfa98jGA05kJS9JbBxTYlN9ukNz3iGaV8mvlXx48/1tlnaOX a6q4BbT7740wSzghJki51E+BPj2G3efNgOsb+agUwUIxazLgoJwxsT07G4ZLhAgJpK8m fw1VKXdEQLj2yu4Sne8UU/hP9Fe+/JJuyJO1wbQZFVOvJJpx4ZgDKd90wLdKz5ZZ5d7h m1yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=IV2DgnwdRpT62qLzr4XJGTomJVcoxS2E2lAyT5oU7pA=; fh=FtWGlnqqdNaWYeoHYcUTjqCFSoyEMXwasmZosU8Dn4Y=; b=kj8sraGAPAo5LqFgcwG4ku1fSilD+wWlcBGbSudIeCs3BrQJ1GaTMJYne6lS6TMzuP 7/4vmwiAdpaUXYmcGlCj9Nybmm2GY58/RN+XGYAC4VV+Cf2v2VvZkQmJ4OXQnH4TA644 zof0IZiXGd+41ZZV3Pytb6vxB0y5HNIrTqShUNNOy1VRxWyOyTNehPQ6ZFU28zfQcBiV nWvDhM4l+ETgpKhGAxw3rAXW4Apl2c6+FaSTLZb9QRI+cWIUSvTT7t11wTqSKnRxDE2B Af8ENzEeGXHzjm0wepn7CAwuqRvjEsbTySThxnXBRT+r+GncIYv82Od5mc3505zBVEdJ WTng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id x62-20020a0dd541000000b0059f57c89016si14629474ywd.119.2023.10.26.04.14.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 04:14:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 82ACB806053E; Thu, 26 Oct 2023 04:14:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230455AbjJZLOY (ORCPT + 99 others); Thu, 26 Oct 2023 07:14:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230146AbjJZLOW (ORCPT ); Thu, 26 Oct 2023 07:14:22 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A9F01AC for ; Thu, 26 Oct 2023 04:14:20 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 438C6C433C7; Thu, 26 Oct 2023 11:14:16 +0000 (UTC) Date: Thu, 26 Oct 2023 07:14:13 -0400 From: Steven Rostedt To: Peter Zijlstra 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 , Mathieu Desnoyers Subject: Re: [POC][RFC][PATCH v2] sched: Extended Scheduler Time Slice Message-ID: <20231026071413.4ed47b0e@gandalf.local.home> In-Reply-To: <20231026105944.GJ33965@noisy.programming.kicks-ass.net> References: <20231025235413.597287e1@gandalf.local.home> <20231026105944.GJ33965@noisy.programming.kicks-ass.net> 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-Spam-Status: No, score=-0.8 required=5.0 tests=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 howler.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 (howler.vger.email [0.0.0.0]); Thu, 26 Oct 2023 04:14:30 -0700 (PDT) On Thu, 26 Oct 2023 12:59:44 +0200 Peter Zijlstra wrote: > On Wed, Oct 25, 2023 at 11:54:13PM -0400, Steven Rostedt wrote: > > > static void extend(void) > > { > > rseq_map.cr_flags = 1; > > } > > > > static void unextend(void) > > { > > unsigned long prev; > > > > prev = xchg(&rseq_map.cr_flags, 0); > > So you complain about overhead and then you add one of the most > expensive ops possible here? xchg has an implicit LOCK prefix and you > really don't need LOCK prefix here. Peter, this is the user space side, where I cut and pasted the code from the file I attached. That has: static inline unsigned long xchg(volatile unsigned *ptr, unsigned new) { unsigned ret = new; asm volatile("xchg %b0,%1" : "+r"(ret), "+m"(*(ptr)) : : "memory"); return ret; } -- Steve > > > if (prev & 2) { > > tracefs_printf(NULL, "Yield!\n"); > > sched_yield(); > > } > > }