Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp646279rdh; Thu, 26 Oct 2023 11:36:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE+3HddFZAZz7AQoqcj9w3IXGyOK1KOYfyIyU9LDYRxz2utprtxu8/39XAf7JPNzP7qO0u9 X-Received: by 2002:a81:e445:0:b0:5ae:b86a:f384 with SMTP id t5-20020a81e445000000b005aeb86af384mr318669ywl.2.1698345399359; Thu, 26 Oct 2023 11:36:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698345399; cv=none; d=google.com; s=arc-20160816; b=X0x5socHG/Sq23SxittmIs+o14L99BMmuUg4hx1I0Zb7dBewULc1DBvPElJw9GAahY wKxOWcSrCbe5Q+Fu9+7PYOKg5JTwkWKkbe8e+vevLiGG3wDwIjT+NPWyCZvpM6jyJumt MIfGCx+RYnhHaMpjtOzVFcaOHp8saiuQRKvVZBfF5JzcrVUVqUCCxkEgY/7/9jnvEsP6 3LKIm68I60bbwzBTNz59epRNBQuizVHwBtrwoyH2+tpSyCfktXrEcB3ZGZbiZkyLfVRl o95irlRTgZRjsXyDD54YCeMCKBsKEYt+N5xemp7L5TZSKL3r5PVb8m8apHjaEcY1GAO+ xHUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=MZSlYInPsd6yrZJrE40E33ZUr6vWcU0Qi23QxPR/6CM=; fh=/9jCt3zu5WXA3ZZLzaiNXV/bTV0WvZnsLpX5iqJkNVM=; b=hMLIjBWeKiDEaWBFjc1/Q3e6LlFNAYTN5o4y6I1s9TE1bYzv+kIvIcWh28aLiKNQ7+ qvsUnO2rjNsWkO22MplEpLtnwbzcSKEtSrpvuSyGlWX5d9MU/t3Kg7xxTQogNxTloGOI 2dwYwJYCiDnzmby3nADPuXb0d66b8M0JtWkefexq7QWV0z/CI1LxvXujtg1TyC4QsRFr CLKFrsEK7gEPUMfsdbnZlDkAu1qfHYVeVNSKDuC8IcIFfDogFBQt6CCws8+xZWZKXyTo +k4MeoGUfQ/DrygEy2NeuaX7Jgn/197SBqVbkFMdceqEULq2FsPknyB08QBrhD1YmcAF P6wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=svHuDhDy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id l76-20020a0de24f000000b005a7a8e90d3esi14965975ywe.152.2023.10.26.11.36.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 11:36:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=svHuDhDy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=efficios.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id CBAF2817DD3B; Thu, 26 Oct 2023 11:36:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231140AbjJZSg0 (ORCPT + 99 others); Thu, 26 Oct 2023 14:36:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230078AbjJZSgZ (ORCPT ); Thu, 26 Oct 2023 14:36:25 -0400 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C460710A for ; Thu, 26 Oct 2023 11:36:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1698345381; bh=wVwxr0EqhCa/79uqd0S0BfYl2wt+pSfYm2ZTXUv0IJg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=svHuDhDy3Ida9p47ja1VfvQycI6QkrRyu10ZjHZY2WQZuQYUNJyTpCg80O9WM9EeR 07/cJGWJSStjt5A/Daw3fAy3FREH73TDChQzfoVuBgNQsdSMiA41J8pWmGkc9d1ok4 t+oCOifi7gPN4j4cYFJyYcMWVGuga8Ks3kUzAKa01MAXU9GEJ8CWFxsfVXRzqpxO7P DlkvL3f6v/GZUoDGIw0iGQwkxCIkKcme6KXMtdWaeWbPvs+FgDu3ac0DqOwQTmaouv Orkv6NoA2RlFsUGXcoLksDThUDcUqlv5hGIjVMlHtCIrItsNtvp7fRmdbHpw1T1ajx dU5pY876gteZw== Received: from [172.16.0.134] (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4SGZJ53Htgz1ZCH; Thu, 26 Oct 2023 14:36:21 -0400 (EDT) Message-ID: Date: Thu, 26 Oct 2023 14:36:36 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [POC][RFC][PATCH v2] sched: Extended Scheduler Time Slice Content-Language: en-US To: Steven Rostedt , 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 References: <20231025235413.597287e1@gandalf.local.home> <20231026105944.GJ33965@noisy.programming.kicks-ass.net> <20231026071413.4ed47b0e@gandalf.local.home> From: Mathieu Desnoyers In-Reply-To: <20231026071413.4ed47b0e@gandalf.local.home> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Thu, 26 Oct 2023 11:36:36 -0700 (PDT) On 2023-10-26 07:14, Steven Rostedt wrote: > 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" which has an implicit lock prefix (xchg with a memory operand is a special-case): Quoting Intel manual: "If a memory operand is referenced, the processor’s locking protocol is automatically implemented for the duration of the exchange operation, regardless of the presence or absence of the LOCK prefix or of the value of the IOPL. (See the LOCK prefix description in this chapter for more information on the locking protocol.)" Thanks, Mathieu > : "+r"(ret), "+m"(*(ptr)) > : : "memory"); > return ret; > } > > -- Steve > > >> >>> if (prev & 2) { >>> tracefs_printf(NULL, "Yield!\n"); >>> sched_yield(); >>> } >>> } > -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com