Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2450260rdb; Thu, 21 Sep 2023 21:14:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE5kbVWsRzWVZDwP7gbrWj62qQw0NqD2bvHyOWiFAhve84PbGlFsyJ9sk7Y7RM2Eg5xB4Zn X-Received: by 2002:a17:90a:cc17:b0:267:70a8:abff with SMTP id b23-20020a17090acc1700b0026770a8abffmr6989690pju.29.1695356084229; Thu, 21 Sep 2023 21:14:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695356084; cv=none; d=google.com; s=arc-20160816; b=y7xdL6e2pYTcA+zaUJeTyl7sMjwBeb502PTO4Zpz3bzYT9GuyNa3kpCtX3La/bjb6V 2OX0XqLQZJbBtdRppFhyR18aHrMrO1eRhuKguu9K6t+EJJOpIjpqEeKr3FnkyFMNVMEU tXXZrYPF/U0Oey9PaQeVMgcEjD/uiQpREBlRjXTwf+LzQTDNevGfvXmkZsCI9V2bzo+c oH/XIweSwrAq2geXJXpGTGesfJiz67sXBQ6PXniXymvUmFLhosQOWiRzrlheLDwvrdIo Zh1vyNb2gNQorYMrSUQ4R0Nfv68n1qk94wMNWNCYtMW12Nt1BexZgDNg8rwRkVQO+tAP Xx+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:in-reply-to:subject :cc:to:dkim-signature:dkim-signature:from; bh=mf4C1LU7+NOwV8ar7ATsCLbsn9zDQYOdXhqIOKCBaIw=; fh=oOMOfsGx4UE9PoK8nRmo+Bqfbr1h+PdvbQTqWTYybWE=; b=GXEVZepBcPBAeJmdojSRWO1qD6Z/lH/1zXBOakykPtIs12nBAYHp7IarapXlyM7cxp sCIx3Pu8xhDRzelQkuUzIjT/8VOeP3qWNBjIiYRMsF5XbbqT1ueNrYLqBLoUYzSkjw+u HgouIltDQGXCRvvw/Q6FhX2z7YTiQ3SGai/hIR6OhE2eLJsJQxSe7vSMA1KNSkoc2lBx Rd2Y20XAejrrV2/42nRTLx+ARmWJSubIx8L3n9M1ypTLxXn3cj7l1fQGaHPAnHZc+SWG xRbD21WwmZX+VkRaP1fwpnUSuwmB8afaFkNRCDgAF/LdNP5zDH8JDJON8HgkTrsIpLiE lV6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=l99t0G+V; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="TwM2g/ZZ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id rm2-20020a17090b3ec200b002741a4172a2si5663244pjb.84.2023.09.21.21.14.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 21:14:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=l99t0G+V; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="TwM2g/ZZ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 729CB805093E; Thu, 21 Sep 2023 15:56:59 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230469AbjIUW4r (ORCPT + 99 others); Thu, 21 Sep 2023 18:56:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230456AbjIUW42 (ORCPT ); Thu, 21 Sep 2023 18:56:28 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5048DCD5 for ; Thu, 21 Sep 2023 15:55:55 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1695336951; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to; bh=mf4C1LU7+NOwV8ar7ATsCLbsn9zDQYOdXhqIOKCBaIw=; b=l99t0G+VKAU9ivFYPA6aSvBhcKOMu9TAAMi68vy8kXnGZL3VMxglO5mEL/MuEJjW6aA9bk AJ8hQZNFODr14SUBVE8uU8GkQarCoznkOmdQnf8Zb7DvCvzIPLvrJgvy8OzrRwq2/C3H7Z sXeoDjaGVStm8cCLH/LbGe5066x/u6soUijfKG5laKOV0FoiTeTwmkvzjiCOH9jCZ15GNn nRarB3wm4l0D+N3qHGUkM3aOPTmVKIBc5ecVIaVATRnYXypJSEjIzH9gCPjLyFB7bZ9B1k Zic93EIXMQzjiOXgEYCDTpcWddAlPdGvsWjWHgiAeD38Yaxw0KbJli2CAMB6wA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1695336951; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to; bh=mf4C1LU7+NOwV8ar7ATsCLbsn9zDQYOdXhqIOKCBaIw=; b=TwM2g/ZZ7PN5b1/ci2RZ0K5evNFZ/JV9R27VV/+x5aZnAAIzj8DPCY9Okr4wz/A9PtvyJ9 GD6tTjiISY6VwdAw== To: Linus Torvalds Cc: Peter Zijlstra , Ankur Arora , linux-kernel@vger.kernel.org, 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, rostedt@goodmis.org, 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, Frederic Weisbecker Subject: Re: [PATCH v2 7/9] sched: define TIF_ALLOW_RESCHED In-Reply-To: Date: Fri, 22 Sep 2023 00:55:51 +0200 Message-ID: <87ttrngmq0.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Thu, 21 Sep 2023 15:56:59 -0700 (PDT) Linus! On Thu, Sep 21 2023 at 09:00, Linus Torvalds wrote: > Ok, I like this. Thanks! > That said, this part of it: > On Wed, 20 Sept 2023 at 16:58, Thomas Gleixner wrote: > Because honestly, without having been part of this thread, I would look at that > > if (nr_bit == TIF_NEED_RESCHED) > set_preempt_need_resched(); > > and I'd be completely lost. It doesn't make conceptual sense, I feel. > > So I'd really like the source code to be more directly expressing the > *intent* of the code, not be so centered around the implementation > detail. > > Put another way: I think we can make the compiler turn the intent into > the implementation, and I'd rather *not* have us humans have to infer > the intent from the implementation. No argument about that. I didn't like it either, but at 10PM ... > That said - I think as a proof of concept and "look, with this we get > the expected scheduling event counts", that patch is perfect. I think > you more than proved the concept. There is certainly quite some analyis work to do to make this a one to one replacement. With a handful of benchmarks the PoC (tweaked with some obvious fixes) is pretty much on par with the current mainline variants (NONE/FULL), but the memtier benchmark makes a massive dent. It sports a whopping 10% regression with the LAZY mode versus the mainline NONE model. Non-LAZY and FULL behave unsurprisingly in the same way. That benchmark is really sensitive to the preemption model. With current mainline (DYNAMIC_PREEMPT enabled) the preempt=FULL model has ~20% performance drop versus preempt=NONE. I have no clue what's going on there yet, but that shows that there is obviously quite some work ahead to get this sorted. Though I'm pretty convinced by now that this is the right direction and well worth the effort which needs to be put into that. Thanks, tglx