From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B2F9C4332F for ; Wed, 8 Nov 2023 12:50:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344412AbjKHMux (ORCPT ); Wed, 8 Nov 2023 07:50:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229654AbjKHMuw (ORCPT ); Wed, 8 Nov 2023 07:50:52 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DFB31BF5 for ; Wed, 8 Nov 2023 04:50:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=5rQmqHyq28sTTx41SOIqjCjlEAdR533KDLfge20GJyA=; b=NvLDaPEObNlQZ7/0u1uC02f+nj DtroOR/1+yb6jRjXuKyms6rhG80O4ap5jN6IfZOLPGroo/dS611lZWyrlMWeyPBhfG3ayEoiB+E9K locsP9xtG+ZKLvaHcarIa2VVPq2u2++trb6Cp8Ar3PXys1IYmx/jgrTUGzhYhI/U+KNhaDxGQOuf7 b7vhoHzjbAaWWlsNCKqu8NFmJtuQnLJPs+H8lYxSfLFT2SQbRAiK8H9JbuhA0dY1O4y45Ti9O5A/W bqitrYXZjB+CJF6ehczO6Ahx4z+kun1wdo/zM5QU1ZDjXb+L1omhK8RE86nZW1zmyAnVYI1nlkvqE 3GSVzkxw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1r0i0y-0013wa-92; Wed, 08 Nov 2023 12:50:37 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 9EB5B30049D; Wed, 8 Nov 2023 13:50:36 +0100 (CET) Date: Wed, 8 Nov 2023 13:50:36 +0100 From: Peter Zijlstra To: Daniel Bristot de Oliveira Cc: Daniel Bristot de Oliveira , Steven Rostedt , Joel Fernandes , Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Ben Segall , Mel Gorman , Valentin Schneider , linux-kernel@vger.kernel.org, Luca Abeni , Tommaso Cucinotta , Thomas Gleixner , Vineeth Pillai , Shuah Khan , Phil Auld Subject: Re: [PATCH v5 6/7] sched/deadline: Deferrable dl server Message-ID: <20231108125036.GD4779@noisy.programming.kicks-ass.net> References: <20231107114732.5dd350ec@gandalf.local.home> <7d1ea71b-5218-4ee0-bc89-f02ee6bd5154@redhat.com> <3e58fad7-7f66-4e48-adcc-0fda9e9d0d07@kernel.org> <20231108124401.GQ8262@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231108124401.GQ8262@noisy.programming.kicks-ass.net> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Nov 08, 2023 at 01:44:01PM +0100, Peter Zijlstra wrote: > Should we rather not cap the runtime, something like so? > Clearly I should've done the patch against a tree that includes the changes... > --- > diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c > index 58b542bf2893..1453a2cd0680 100644 > --- a/kernel/sched/deadline.c > +++ b/kernel/sched/deadline.c > @@ -829,10 +829,12 @@ static inline void setup_new_dl_entity(struct sched_dl_entity *dl_se) > */ > static void replenish_dl_entity(struct sched_dl_entity *dl_se) > { > + struct sched_dl_entity *pi_se = pi_of(dl_se); > struct dl_rq *dl_rq = dl_rq_of_se(dl_se); > struct rq *rq = rq_of_dl_rq(dl_rq); > + u64 dl_runtime = pi_se->dl_runtime; > > - WARN_ON_ONCE(pi_of(dl_se)->dl_runtime <= 0); > + WARN_ON_ONCE(dl_runtime <= 0); > > /* > * This could be the case for a !-dl task that is boosted. > @@ -851,10 +853,13 @@ static void replenish_dl_entity(struct sched_dl_entity *dl_se) > * arbitrary large. > */ > while (dl_se->runtime <= 0) { > - dl_se->deadline += pi_of(dl_se)->dl_period; > - dl_se->runtime += pi_of(dl_se)->dl_runtime; > + dl_se->deadline += pi_se->dl_period; > + dl_se->runtime += dl_runtime; > } > > + if (dl_se->zerolax && dl_se->runtime > dl_runtime) > + dl_se->runtime = dl_runtime; > + This should ofcourse go in the if (dl_se->dl_zerolax_armed) branch a little down from here. > /* > * At this point, the deadline really should be "in > * the future" with respect to rq->clock. If it's