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 EEF91C25B6B for ; Thu, 26 Oct 2023 18:36:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6AB898D002D; Thu, 26 Oct 2023 14:36:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 659DE8D0001; Thu, 26 Oct 2023 14:36:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 54BC48D002D; Thu, 26 Oct 2023 14:36:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 434EA8D0001 for ; Thu, 26 Oct 2023 14:36:25 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 233971CAF46 for ; Thu, 26 Oct 2023 18:36:25 +0000 (UTC) X-FDA: 81388467930.11.12B528B Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf16.hostedemail.com (Postfix) with ESMTP id 32D4A180003 for ; Thu, 26 Oct 2023 18:36:23 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=svHuDhDy; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf16.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1698345383; 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:dkim-signature; bh=MZSlYInPsd6yrZJrE40E33ZUr6vWcU0Qi23QxPR/6CM=; b=skvlHMbFnAAUXgqmC0MRYkeQt0bED/krxxdcWZjUS6f3zCCh1Py3l8yTD2EQCWmm1Sqy0y KQUpYi3GSLwn87Ryn3hGI7Yx5CW8pjqGO1ob2wPQ/RgRCxNIz68zz59f3COtM5A3FpWoJ6 aTRZDf3Lc8flP9VIehi1dWbZVRo82Ow= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=svHuDhDy; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf16.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1698345383; a=rsa-sha256; cv=none; b=A/PYNLr8TPJXjvjKIwyxK3qltDnW7nafwKQ8X+dp04ZknRuUqC4IoRU4u9VxJst4Ln9/Pu NLa0Fl5i3+F3Ec1yTTPzo4b6+5FRVq1diF5z96zV5Lb5EmAyxZi+6fu5vTTbhYtwA/7AIa dWySPmwkoxIVaZ8N1gCEiZa7QweJ+eU= 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-Rspam-User: X-Stat-Signature: pj5mxendhskfgkjweqffzq5rgttkcgdw X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 32D4A180003 X-HE-Tag: 1698345383-26036 X-HE-Meta: U2FsdGVkX1/J5SYE0+w3Ris4iBORpxzyLj10GZi0y/qKrYRaXUJ1nz7Wpx1bbbAmIE8R/krzd0bsexsP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uvHS+BHqt1ZwwnMJ9QhGKwHVycG+xLUmT66x2XsH3XCPqKz8+LupeR0UE2VcB0osv6tpDHk7TXh9ux3mrP4hOMsor0TUrTJ0bwg40YMHFJHcKgTDcdyv1P/zozwutAd0+DSvNgVt1oThGyCXOLx51ChUN+HjWICwjOE242yNwUo5FRT+WOGVbf7kHEpaVkIHucc= 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 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