Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2982199rdb; Fri, 22 Sep 2023 14:12:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFLwI3BO5FPKkR6dItb4Tud6QrWNqXMYtzhADKd9HQiqOfIPQEkqA8eSDC/ntZiuwGXXsO8 X-Received: by 2002:a17:902:ce8e:b0:1bc:6861:d746 with SMTP id f14-20020a170902ce8e00b001bc6861d746mr676657plg.58.1695417149775; Fri, 22 Sep 2023 14:12:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695417149; cv=none; d=google.com; s=arc-20160816; b=sonOG2f1CCZPD5anFAyVV+XGPlwtSbs4w5yuy0IFmSdVYhMpyR4xZFRnQUneIBaFg3 mAVEcU3x2uTbh9Su/IdWwNuP4nD8wTTdTijS/tyyS+WL2vG9JpUZmLxoHYm4PMK6IcN6 yzcNdIynIK9NR1sr2kxTjTgaPFYhMHhXgMdYla0sbxoDo+coOP78AlKD8POkEIVayGku wuWCJb57RJRrY9xLrLZMuv320pH38QPxSUNNHGUtHcyvamjrVGqpJGsUEUprFZAV1V+d Vso+7dB/5qf+aC5SPrngcWsznp5I5HW6XHB63plgPRCitw88ASxliT3e+QfNjL2R/qrT kq8w== 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:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=R7vVBda9gvcvqlzUBjjzT9jNAI4rEfJOwwmk972/3PU=; fh=OgaN3n9yQF0IFpr6Si/HN6gcmcOlg456uQiRmOEVdQ4=; b=GqxD1msslepF8KltGWh0G2UbFmenxwp9aSnRITRabDzhDYn3bxAfoyUCAmyXD0N/gp 0IMDf3bxHmllu9gia9/f3+xHQO17FR2QmMf4JZ3YmfRX4uMqBE5FEI5a5+IWgvFoH697 3ZR7ch0wzdIkKhRFsctH9wMggeBpeYPBtx6Og6HKmWk0JkNG19K0485bY1PUTTDDE2fa /9gBFKP7pYm5iv6DsYPbe6VOUuK4epZDXOXchMkisxh1ngiCabb3jfBJ++jfE/YyeCXE kwqeUa6KJCzZqSSlW7HVQODDd/SNC/xLAwYapJgJLBV2xxZPWvVJ0Gy9cxIGlI/qybf7 Se/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ogBI4O6f; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=jJA0HmiX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id lg16-20020a170902fb9000b001b7f849cd12si4398183plb.81.2023.09.22.14.12.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 14:12:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ogBI4O6f; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=jJA0HmiX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 7EE96832C374; Wed, 20 Sep 2023 19:02:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229732AbjIUCCK (ORCPT + 99 others); Wed, 20 Sep 2023 22:02:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229603AbjIUCCJ (ORCPT ); Wed, 20 Sep 2023 22:02:09 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A3F7BB for ; Wed, 20 Sep 2023 19:02:03 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1695261721; 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:references:references; bh=R7vVBda9gvcvqlzUBjjzT9jNAI4rEfJOwwmk972/3PU=; b=ogBI4O6fwkuLRnY+Vzhprbc+qTFmU7x2aYzM0yF/sKa4gViHGhx49AY7phU642gLDd1h2I 5qz/YI5PD/nxfpxSf+9SMeEZ6A4eYzAEU7B5AhhfgoFFzATcI/8jWvIQq33qcRggw0wqQi +bQmdW5wBu1TqNNcZt6u5AAy9Z4BdnkdeOzufnAem+7DU8m9Kf9olgXg3pvOiGo2iqnn+T wGXAIcg4dxUOgliIYCqiW+xk+Ki0lNtAZkUzP8Zwsd+v3vQChbjDCvYq2JoOyPp0rRDnBa FER4gxKUe8wHFMaod9ZbDEbEVqdwmKiZs2KdeBibFhF0AEjHJrEQGtnZpEX5YA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1695261721; 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:references:references; bh=R7vVBda9gvcvqlzUBjjzT9jNAI4rEfJOwwmk972/3PU=; b=jJA0HmiXaG/8raS9gLO+e4rwncohcsaxDM4qlc7rLUqH8+znF5rGDEYPg+mVzYbcdPbczr Nrm8Tzp5j2TWLvCg== To: Ankur Arora Cc: Linus Torvalds , 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: <87edisibrp.fsf@oracle.com> References: <20230830184958.2333078-8-ankur.a.arora@oracle.com> <20230908070258.GA19320@noisy.programming.kicks-ass.net> <87zg1v3xxh.fsf@oracle.com> <87edj64rj1.fsf@oracle.com> <87zg1u1h5t.fsf@oracle.com> <20230911150410.GC9098@noisy.programming.kicks-ass.net> <87h6o01w1a.fsf@oracle.com> <20230912082606.GB35261@noisy.programming.kicks-ass.net> <87cyyfxd4k.ffs@tglx> <87led2wdj0.ffs@tglx> <8734z8v1lo.ffs@tglx> <87edisibrp.fsf@oracle.com> Date: Thu, 21 Sep 2023 04:02:00 +0200 Message-ID: <87ttrothbb.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 groat.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 (groat.vger.email [0.0.0.0]); Wed, 20 Sep 2023 19:02:11 -0700 (PDT) On Wed, Sep 20 2023 at 17:57, Ankur Arora wrote: > Thomas Gleixner writes: >> Find below a PoC which implements that scheme. It's not even close to >> correct, but it builds, boots and survives lightweight testing. > > Whew, that was electric. I had barely managed to sort through some of > the config maze. > From a quick look this is pretty much how you described it. Unsurpringly I spent at least 10x the time to describe it than to hack it up. IOW, I had done the analysis before I offered the idea and before I changed a single line of code. The tools I used for that are git-grep, tags, paper, pencil, accrued knowledge and patience, i.e. nothing even close to rocket science. Converting the analysis into code was mostly a matter of brain dumping the analysis and adherence to accrued methodology. What's electric about that? I might be missing some meaning of 'electric' which is not covered by my mostly Webster restricted old-school understanding of the english language :) >> I did not even try to look into time-slice enforcement, but I really want >> to share this for illustration and for others to experiment. >> >> This keeps all the existing mechanisms in place and introduces a new >> config knob in the preemption model Kconfig switch: PREEMPT_AUTO >> >> If selected it builds a CONFIG_PREEMPT kernel, which disables the >> cond_resched() machinery and switches the fair scheduler class to use >> the NEED_PREEMPT_LAZY bit by default, i.e. it should be pretty close to >> the preempt NONE model except that cond_resched() is a NOOP and I did >> not validate the time-slice enforcement. The latter should be a >> no-brainer to figure out and fix if required. > > Yeah, let me try this out. That's what I hoped for :) Thanks, tglx