Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2176131rdf; Mon, 6 Nov 2023 06:56:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IFv5JSpXqwVxtTtE0FTNweoKfd9Xesi8bgyfeJzS//o2X6U11hYsdWP6So0xBCuSTx+0/Zw X-Received: by 2002:a17:90a:195b:b0:27d:5f1f:8eed with SMTP id 27-20020a17090a195b00b0027d5f1f8eedmr22089678pjh.14.1699282562719; Mon, 06 Nov 2023 06:56:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699282562; cv=none; d=google.com; s=arc-20160816; b=KJEGvm/nSkjKO/GKQ1JyTt/9HnsFrnMzfp8LYhc2T2S74ofWaWeKx8QkIg0e9lgZLA S3zPeo+AjWy9dyFC6GnHeq02V2AuQ5NAhLV7DAMwsgClWUD+q00LIFbonhg4fgpJZse4 SXrQdZPHyDiYquEq9RFhXPDmYh+x0TY6oEqZ3JTcTL4q8mzlesiSW4x3Mw1nu+dYOfkY uCVP3OMOE0TzFWG5cXy4ex9oNDfqIWFbBrrFlUtLLiv6TwfuAAuSbYsTZEUzStkP+Kv4 lfq9ZUNbjZT6j1vuO9xxZ8vtDoGnNvtyWmCsTsQc8NK9TcfLvN4Zq90oh5qYFjMoQvWv XSCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qvU8Xyqhs1wH5xyO0C4Nf41uT9frHkMXUO274zeOckc=; fh=TqUufSrsSTunWvlKWl6WsuSIqHx0uhxZWTQpn6Im9mg=; b=HmFu0zt+KEqvKfJmfT2iRmG9bHHwOXQEkxT7+obPh2OavrmrhCAN4nD4MmoKQeLOCe 3dcO8drs+Di71TawnePzwxHwz0mLjPlSDuCziZ7P0rrkKftrJyCmeS0dVIUh7RgfGSYb hlWa+6qJXAvjV8Zygmrbos4L2wDJheGtwUtoTF1+9xDlhCFFpgY3JtDPTc76q4pUsqi8 xTV33YdbqNyJCG022ObtJ+wkebsIk1BT1YstuX23Vo+9iX+JzcyE9FBOh9OCA/+i6VGP unooMu5qIf/kjRCE95vi9bor3/qvuuqG2FgEEfAOKEosDJ8U7XGJWqHvmsT7+3YRGPUL OSRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ufN2Auc+; 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 Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id il8-20020a17090b164800b00279020d1fb0si2810013pjb.129.2023.11.06.06.56.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 06:56:02 -0800 (PST) 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=@infradead.org header.s=casper.20170209 header.b=ufN2Auc+; 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 Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id AD66C80ADC54; Mon, 6 Nov 2023 06:55:59 -0800 (PST) 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 S232011AbjKFOzr (ORCPT + 99 others); Mon, 6 Nov 2023 09:55:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231966AbjKFOzn (ORCPT ); Mon, 6 Nov 2023 09:55:43 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 185D9D6F for ; Mon, 6 Nov 2023 06:55:39 -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=qvU8Xyqhs1wH5xyO0C4Nf41uT9frHkMXUO274zeOckc=; b=ufN2Auc+tran6e9TEnYUAgvmAz WDCMsHESuR0DOIA41SsM+z5VUlKlYDkfbvtbx3V65z2fD4FONWBCZ00Dys31GuTlFyE6kfZ7F17P4 FGi4ztCotXrJ7E2m5mglMr7hQP90u0pq6AnXFuJejXx/prjG7ob2Qoz4uRYYvbpFdl5pusGJmlyyx Y9xzrm+hFqXOeQ33ZAOirnJeuX3oEQj2LSYLfv6EUe1v3n1eBGlOJY9gUF4fTupXbdds+2xCNZIlK rhqpaTPCFL+oM9PjXeYENxH5LdjG2bUhVs6qPCJL2f25aNTrrDWtF0cKZGUsI0e/Xjp2rmIWgXAm0 sYUet1XQ==; 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 1r010Z-006ZR2-5J; Mon, 06 Nov 2023 14:55:19 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 6926B300592; Mon, 6 Nov 2023 15:55:19 +0100 (CET) Date: Mon, 6 Nov 2023 15:55:19 +0100 From: Peter Zijlstra To: Daniel Bristot de Oliveira Cc: Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , linux-kernel@vger.kernel.org, Luca Abeni , Tommaso Cucinotta , Thomas Gleixner , Joel Fernandes , Vineeth Pillai , Shuah Khan , Phil Auld Subject: Re: [PATCH v5 6/7] sched/deadline: Deferrable dl server Message-ID: <20231106145519.GG3818@noisy.programming.kicks-ass.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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]); Mon, 06 Nov 2023 06:55:59 -0800 (PST) On Sat, Nov 04, 2023 at 11:59:23AM +0100, Daniel Bristot de Oliveira wrote: > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index b15f7f376a67..399237cd9f59 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -1201,6 +1201,8 @@ static void update_curr(struct cfs_rq *cfs_rq) > account_group_exec_runtime(curtask, delta_exec); > if (curtask->server) > dl_server_update(curtask->server, delta_exec); > + else > + dl_server_update(&rq_of(cfs_rq)->fair_server, delta_exec); > } > > account_cfs_rq_runtime(cfs_rq, delta_exec); I've rewritten that something like so.. --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -1182,12 +1182,13 @@ s64 update_curr_common(struct rq *rq) static void update_curr(struct cfs_rq *cfs_rq) { struct sched_entity *curr = cfs_rq->curr; + struct rq *rq = rq_of(cfs_rq); s64 delta_exec; if (unlikely(!curr)) return; - delta_exec = update_curr_se(rq_of(cfs_rq), curr); + delta_exec = update_curr_se(rq, curr); if (unlikely(delta_exec <= 0)) return; @@ -1195,8 +1196,17 @@ static void update_curr(struct cfs_rq *c update_deadline(cfs_rq, curr); update_min_vruntime(cfs_rq); - if (entity_is_task(curr)) - update_curr_task(task_of(curr), delta_exec); + if (entity_is_task(curr)) { + struct task_struct *p = task_of(curr); + update_curr_task(p, delta_exec); + /* + * Any fair task that runs outside of fair_server should + * account against fair_server such that it can account for + * this time and possible avoid running this period. + */ + if (p->dl_server != &rq->fair_server) + dl_server_update(&rq->fair_server, delta_exec); + } account_cfs_rq_runtime(cfs_rq, delta_exec); }