Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp246408lqc; Thu, 7 Mar 2024 16:42:48 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVWvU/vF17Ezo/PCm2LTy7KwSyJ5YN2dE9K3jDl4dd70K0qD+2CnYd26zwR53sV3135O7vY4FVP4YcRa/j7ZIxtYPkfX0ZImSnoiktLuw== X-Google-Smtp-Source: AGHT+IGqoSJbRiyyxIs04eaRwoixENFAwyOdjbpwgC+cMTgQ3Og7LasYQBUiNlBs/jgXEbg+c21D X-Received: by 2002:a17:906:aa47:b0:a45:c8cf:2ca with SMTP id kn7-20020a170906aa4700b00a45c8cf02camr2966181ejb.69.1709858568815; Thu, 07 Mar 2024 16:42:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709858568; cv=pass; d=google.com; s=arc-20160816; b=SQgUpHRepBu9iL1dJRqdV0ZmP7xjnynZobLawFpXCXJZ0aytioBshBVX4F7n4xbW15 0zwdO0qtfdUY0+R5nrO39SPX7v6LXoBwVIRLQDl4sUv6CDAB09xrxtYDHjGmO47sD/GZ Ps+miVW2gnqlPGE327m9KrPiLkrbupQkYcqLsg/jrdG6ShUWeRFrIwQiJhaekYSbXuXc a+l4CaaqvG0kPHSoj62/4KCO6wYlxw+w9X2xPlGvkEIA53spXYXZO3RASaOkJNRvWXwv Y0ngZQmYZpWQgHNn4lr0emUamlw900qpYBvBJ2zXSQwYRkfwvF96lthbuQmGa2jtpqqJ XuBQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=Zua5j4THgtNybDl7PJfc+4yAGvcZy0dFGryZWCRzx+Y=; fh=9dllI/anPfaIHakwudS2RqE32kJdvDPE/NHRB/FwrJs=; b=CeJBus9v3wpJ3cq1FHHkMnMaTCl6yNKtbyUVL2i8fl9atrDzX8BqCDbVzxjmS8ilIy c0ROWAeyhgTwexNbkz9RpNS27TWgSbHniOZpWBO2/eDq9S1hfl/tyy0/yqJspVL3K8Ir kINW/8BzsZ5Gh9mP7wG8nKBPgZyf8QkDep9r8goBsHZmE1tL8Eqm+NAImkxOGCZym37p 7ny2EuHAHxsYNrtsAy/EE2Xs9K/Q7JmGfhdu0P/J+DaO094Areakcm65JAx1nQmJ9xZ0 m00m8wNfzilxbD20RLN2rfuklus5dofa0GgoIEGxIiXSpC8pc5oGfv2e0SPCiQdrzPSq L/wg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PVAxHzf+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-96394-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96394-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id rh9-20020a17090720e900b00a44aaf24411si5939784ejb.918.2024.03.07.16.42.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 16:42:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-96394-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PVAxHzf+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-96394-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96394-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 83AC61F21D25 for ; Fri, 8 Mar 2024 00:42:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 21C806FC2; Fri, 8 Mar 2024 00:42:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PVAxHzf+" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0C8A333DF for ; Fri, 8 Mar 2024 00:42:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709858561; cv=none; b=e/eLmuLSTdSDTpddXFupUCa0UYkD+cDAGMLFJEQo7/mCnQBtFUFA1ObvqZ7VYt5s/7nZvSL7DhwGenRw8itzPgs2uVQ8eqbVEsGagHhqCvXCAFn0UFFeP+4CVSxYGeFqxS/fcc9tgkKHKG7L66YU8YjH8pMdMWJiMb34SSsWa58= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709858561; c=relaxed/simple; bh=GpY9dw+ustLRfoL+aEbC4Nk0SbRKW1jvdATueqqLNU4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SsNzEX5meYwQHVCOyty54bbW/Dv+tOs9gsp6/1q4TxXjayxoZVKneYRErAiXLTta9KO/UNYCxY4EQTq2RxSb13Klydr++rMNnMzu/aTNMI4UfDLe9Tl0eVovAf6nAqwgJsnzfjbMHTMFfVN1ZKCrkiVUCY6JpmrKongIyuZVn6M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PVAxHzf+; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75977C433C7; Fri, 8 Mar 2024 00:42:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709858560; bh=GpY9dw+ustLRfoL+aEbC4Nk0SbRKW1jvdATueqqLNU4=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=PVAxHzf+LqtwpIC2hN6Ji430+hk8drUgIDwrd2ZarG7v/0R7FqwbPyXaYkys2SVHd 2lJV3VFkrrVCwa2ZQvklFmR08cJRUzXO0c4CYSM5Fyegb6fJT35Q+JUIrSktJR/d6v AhDaB/OL3HGPdvyOOJBNg62xio9WWO113CYb/kmJcoqM8QmLaUURdFGm1B50neeg6y z6lFNayNqEyEpRCSmmITfzbaxYooUbWWTgFzVu4/cTmPlbBGAR8jsqQlURoJ28Gpej zM8AsGYIyofcbNf2tDJNH+mbkJomumHwrZ8tXhr0VgX6F+09RI78398NcjKkEodtbq agIZwXlWBHOQg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 1D7B2CE0716; Thu, 7 Mar 2024 16:42:40 -0800 (PST) Date: Thu, 7 Mar 2024 16:42:40 -0800 From: "Paul E. McKenney" To: Joel Fernandes Cc: Ankur Arora , linux-kernel@vger.kernel.org, tglx@linutronix.de, peterz@infradead.org, torvalds@linux-foundation.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, jpoimboe@kernel.org, mark.rutland@arm.com, jgross@suse.com, andrew.cooper3@citrix.com, bristot@kernel.org, mathieu.desnoyers@efficios.com, geert@linux-m68k.org, glaubitz@physik.fu-berlin.de, anton.ivanov@cambridgegreys.com, mattst88@gmail.com, krypton@ulrich-teichert.org, rostedt@goodmis.org, David.Laight@aculab.com, richard@nod.at, mjguzik@gmail.com, jon.grimm@amd.com, bharata@amd.com, raghavendra.kt@amd.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com Subject: Re: [PATCH 26/30] sched: handle preempt=voluntary under PREEMPT_AUTO Message-ID: <6054a8e0-eb95-45a3-9901-fe2a31b6fe4e@paulmck-laptop> Reply-To: paulmck@kernel.org References: <20240213055554.1802415-1-ankur.a.arora@oracle.com> <20240213055554.1802415-27-ankur.a.arora@oracle.com> <65e3cd87.050a0220.bc052.7a29@mx.google.com> <87frx514jz.fsf@oracle.com> <12a20651-5429-43df-88d7-9d01ff6212c6@joelfernandes.org> <63380f0a-329c-43df-8e6c-4818de5eb371@paulmck-laptop> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Mar 07, 2024 at 07:15:35PM -0500, Joel Fernandes wrote: > > > On 3/7/2024 2:01 PM, Paul E. McKenney wrote: > > On Wed, Mar 06, 2024 at 03:42:10PM -0500, Joel Fernandes wrote: > >> Hi Ankur, > >> > >> On 3/5/2024 3:11 AM, Ankur Arora wrote: > >>> > >>> Joel Fernandes writes: > >>> > >> [..] > >>>> IMO, just kill 'voluntary' if PREEMPT_AUTO is enabled. There is no > >>>> 'voluntary' business because > >>>> 1. The behavior vs =none is to allow higher scheduling class to preempt, it > >>>> is not about the old voluntary. > >>> > >>> What do you think about folding the higher scheduling class preemption logic > >>> into preempt=none? As Juri pointed out, prioritization of at least the leftmost > >>> deadline task needs to be done for correctness. > >>> > >>> (That'll get rid of the current preempt=voluntary model, at least until > >>> there's a separate use for it.) > >> > >> Yes I am all in support for that. Its less confusing for the user as well, and > >> scheduling higher priority class at the next tick for preempt=none sounds good > >> to me. That is still an improvement for folks using SCHED_DEADLINE for whatever > >> reason, with a vanilla CONFIG_PREEMPT_NONE=y kernel. :-P. If we want a new mode > >> that is more aggressive, it could be added in the future. > > > > This would be something that happens only after removing cond_resched() > > might_sleep() functionality from might_sleep(), correct? > > Firstly, Maybe I misunderstood Ankur completely. Re-reading his comments above, > he seems to be suggesting preempting instantly for higher scheduling CLASSES > even for preempt=none mode, without having to wait till the next > scheduling-clock interrupt. Not sure if that makes sense to me, I was asking not > to treat "higher class" any differently than "higher priority" for preempt=none. > > And if SCHED_DEADLINE has a problem with that, then it already happens so with > CONFIG_PREEMPT_NONE=y kernels, so no need special treatment for higher class any > more than the treatment given to higher priority within same class. Ankur/Juri? > > Re: cond_resched(), I did not follow you Paul, why does removing the proposed > preempt=voluntary mode (i.e. dropping this patch) have to happen only after > cond_resched()/might_sleep() modifications? Because right now, one large difference between CONFIG_PREEMPT_NONE an CONFIG_PREEMPT_VOLUNTARY is that for the latter might_sleep() is a preemption point, but not for the former. But if might_sleep() becomes debug-only, then there will no longer be this difference. Thanx, Paul