Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp658370rdh; Thu, 26 Oct 2023 11:59:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEw5oo2yXCWy+VP4+gp6siipkXJNj6Aqq3I3jSyJNnTcWnweav9qa/t9+u1bOkSe85P+jEB X-Received: by 2002:a81:b65c:0:b0:5a7:b3d0:82c2 with SMTP id h28-20020a81b65c000000b005a7b3d082c2mr1167986ywk.12.1698346760197; Thu, 26 Oct 2023 11:59:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698346760; cv=none; d=google.com; s=arc-20160816; b=0oasRFhzFetQ+/XDSuqW0QCdf2kXkUIjQgMkTK0BJ1rpABo4K/TKdyIY+so3JmWhbP 2KuRf4YgxnWVUvEy+P/hr7oYWcqeWlG8gy3bSJpNk/JkfUignChXibd81G4EElwJVDwD QETVv9InQxt1BrU7ujw+Xwvfc2piE7vsMbmRYgd7rzIq9aFPPDteQS3o4zpflZSHs8AZ x721s9RyexdIpPWBkQ35/JmGtrdrrMwW2jnrjFcTJqiR2iabjhJPLXKEzzdGT8+2UllF pP+gtEJY30WAv3UeTHP5azmY9sFvFX2AMXPs7F8xnCUQgGvg0QWg5i2rztbSQnsD59Ud TsNA== 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=vOnIeZ2ls0o/9wLk0QYQb01FzGPOX2CxutRn0ghAsa4=; fh=e/YkjUKehkWBuZRz6EPx/Ey2pg93zCKQgNReLZ7JKIw=; b=D5jMueVpED1BAXYeS895tIgni+0rZZPAQPPrXIJMTtIY4Lu0pnd6hbxt7DJCTC621X vTDMnCQ6dogU1XxcGZmDX1psUiGmb8wR6JsmqhPCJouJYmR6S/p96XGPKOl35VQuQeRy HQJ6sfO2pjnkGd0+JvMycgzMeJZaWZ+Zc+JcLNPlZpFbw755Q7o+C8WO5UjlTGr4Asta 8XelTBHlFBeEo52MTgoOMAJu8zk2x6EuSXSFIeVAX0mXt/EMn8TZPCw3byt+rICeykVs 8mQJ1XPi+YZzFC5B6BokmbiLcrpmqM/JZG/XxLxP7ZB87xcb6ABSWvAsNxwFqNb6mCVO 4nnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=HZurCEie; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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. [23.128.96.36]) by mx.google.com with ESMTPS id u66-20020a814745000000b005a7ad67b4bdsi15894496ywa.512.2023.10.26.11.59.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 11:59:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@efficios.com header.s=smtpout1 header.b=HZurCEie; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 9D64A81C2003; Thu, 26 Oct 2023 11:59:16 -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 S234866AbjJZS7D (ORCPT + 99 others); Thu, 26 Oct 2023 14:59:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232108AbjJZS7B (ORCPT ); Thu, 26 Oct 2023 14:59:01 -0400 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8D60F1AD for ; Thu, 26 Oct 2023 11:58:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1698346738; bh=EzH15LLRG+ol+aSrFbKJfdK9hIa1sr7P6ThkbyXJ/9c=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=HZurCEiejfK4ERnwCy7KHs4XpysBsfsxQIhtI7vW32hYkhGOOQ7a9qUVklxIpPHG7 YTWUnvLUiHrgoAhi/Vcllhisd0Swg2wJAWTpA7yFPXiRSKIUf5wyZxuvl4wGsSLNQe 8mtaQA0b84AD5y2tIhEET6bdMB1I3htbnLmKyuJlVH24DH2wTQaQmU+3OxpPMJY0U5 UVqeiDm21thNFkIZqWQkwMkYb7y1aloeZlrJ+R4Ohl6vwGS9NItgHJoeCEturDIWH1 QToga4bAlsbSugRqT7yj9U+L1Me079VBI8eXB1oMSrQtQzXOVbFOT5S5U+E4425Ajn YDB/LjyzWhNew== 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 4SGZpB1lgCz1Zd1; Thu, 26 Oct 2023 14:58:58 -0400 (EDT) Message-ID: <7871472b-a0c4-4475-9671-69a3244f956d@efficios.com> Date: Thu, 26 Oct 2023 14:59:13 -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: Linus Torvalds Cc: Steven Rostedt , 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 References: <20231025235413.597287e1@gandalf.local.home> <20231026105944.GJ33965@noisy.programming.kicks-ass.net> <20231026071413.4ed47b0e@gandalf.local.home> From: Mathieu Desnoyers In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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:59:16 -0700 (PDT) On 2023-10-26 14:50, Linus Torvalds wrote: > On Thu, 26 Oct 2023 at 08:36, Mathieu Desnoyers > wrote: >> >>> asm volatile("xchg %b0,%1" >> >> which has an implicit lock prefix (xchg with a memory operand is a >> special-case): > > Yeah, this is why we do "percpu_xchg()" - which does not want locked > semantics - as a "cmpxchg" loop. > > Steven, check out > > arch/x86/include/asm/percpu.h > > for a rough implementation of a 'xchg()' without SMP coherency, just > cpu-local one (ie atomic wrt being preempted by the kernel, but not > atomic wrt other CPU's accessing the same variable concurrently) Actually Steven does not need a xchg to test-and-set a single bit which is only accessed concurrently between kernel and userspace from the same thread. Either "bts" or "andb" should work fine. Thanks, Mathieu > > Linus -- Mathieu Desnoyers EfficiOS Inc. https://www.efficios.com