Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp682089rdh; Thu, 26 Oct 2023 12:37:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFIHL+hd9dPHi2Mr+6OGW3pQFHTSv9FnytG9yrdXV5TkeE/Q6V2fs2j+Xw3TaIG4WQGV8UI X-Received: by 2002:a25:44:0:b0:d9a:5409:60a8 with SMTP id 65-20020a250044000000b00d9a540960a8mr6444562yba.14.1698349029441; Thu, 26 Oct 2023 12:37:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698349029; cv=none; d=google.com; s=arc-20160816; b=tXxrl09OR2c+J/h319Owy4kLV/pNQovKKmX+0MJdLaMzKYghAHwE8WGyyVaH5H8LBk f08cwRGy8292YjgwuLar16cGLILCe2Tar5PCxFb45OdtWSmCXvUdSRAtafb7I3jyZmmx 4pQrXT4f6sbn7qTB/A7OuWIUEAFa+c7uIB4XWHWunKZZtvGTDuJ7Iwq/zkXgOiewuaLr uOmIfEYKXUVaaErTLezsLTtk+yhIbCHFJsQbExyV3Xq+AnGuDMmntFV4WTr6WxUBsS3P Xx43GM/2oozzH+zRWFqAGsY9/ZtyzuZe3qx/VcBu4WUC3LosLJclNtjf4lvFniQeUJNa 6kTg== 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=Shf1A3/HUIt2u8uOFJ1YonqbUFaHK5uiEETVGglAeMY=; fh=SfvE4YKxHarc+4mYRLQvWrf/g5l7JvlvohgguvJ6moM=; b=BE38GTyb4O0JJZbo1sxV/gwGGj+4y323BUVWnNS96NnlEwswB9QF41XdvlemYwC3EG biVs4X6BuwF2gWk7O6ZHsu2WmiMRMYZk2JqgmQ9IIguTpmc202WIfgG0GET2qzAmsOec 1KrGLEU0thp8291Fa+Wzs/8h4xiefhT2syZmATrGC0wKAuMNCKGWYYd1qpcemYP2wPIp qjbduMzwRrlF8WLYf3oTtXQl6xiFsSVpZxWxqI8EH7ZQ/3Dp0mImCCFAxPRp5N1kF/Mo QmXmik1qGMUj96AdNEH8E3PV7hZ04UmTG50VYTI+ol/ZUnfUh+QF7LZ+1jiafZ5HdaRg t34A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id v127-20020a254885000000b00d9a3596a13csi142225yba.100.2023.10.26.12.37.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 12:37:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 9BE5A83C7593; Thu, 26 Oct 2023 12:37:06 -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 S232236AbjJZTgx (ORCPT + 99 others); Thu, 26 Oct 2023 15:36:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231975AbjJZTgu (ORCPT ); Thu, 26 Oct 2023 15:36:50 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E2EA1BD for ; Thu, 26 Oct 2023 12:36:48 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ECBAFC433CA; Thu, 26 Oct 2023 19:36:43 +0000 (UTC) Date: Thu, 26 Oct 2023 15:36:42 -0400 From: Steven Rostedt To: Mathieu Desnoyers Cc: Linus Torvalds , 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 Subject: Re: [POC][RFC][PATCH v2] sched: Extended Scheduler Time Slice Message-ID: <20231026153642.06bb418b@gandalf.local.home> In-Reply-To: <7871472b-a0c4-4475-9671-69a3244f956d@efficios.com> References: <20231025235413.597287e1@gandalf.local.home> <20231026105944.GJ33965@noisy.programming.kicks-ass.net> <20231026071413.4ed47b0e@gandalf.local.home> <7871472b-a0c4-4475-9671-69a3244f956d@efficios.com> 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 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]); Thu, 26 Oct 2023 12:37:06 -0700 (PDT) On Thu, 26 Oct 2023 14:59:13 -0400 Mathieu Desnoyers wrote: > > 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 Linus and Mathieu! Yeah, I just changed it to andb and that works just as well (or better). When I first made the change, it became substantially worse. But then I realized it was because I had "addb" and not "andb" :-D -- Steve