mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marcel Ziswiler <marcel.ziswiler@codethink.co.uk>
To: "Vineeth Pillai (Google)" <vineeth@bitbyteword.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	 Joel Fernandes <joel@joelfernandes.org>,
	shraash@google.com, i.maximets@ovn.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] sched/dlserver: fix dlserver time accounting
Date: Fri, 13 Dec 2024 11:10:52 +0100	[thread overview]
Message-ID: <41be49a210d5ef1c48cd0cbfe23a52368cb049b9.camel@codethink.co.uk> (raw)
In-Reply-To: <20241213032244.877029-2-vineeth@bitbyteword.org>

Thank you very much, Vineeth

On Thu, 2024-12-12 at 22:22 -0500, Vineeth Pillai (Google) wrote:
> dlserver time is accounted when:
> - dlserver is active and the dlserver proxies the cfs task.
> - dlserver is active but deferred and cfs task runs after being picked
>   through the normal fair class pick.
> 
> dl_server_update is called in two places to make sure that both the
> above times are accounted for. But it doesn't check if dlserver is
> active or not. Now that we have this dl_server_active flag, we can
> consolidate dl_server_update into one place and all we need to check is
> whether dlserver is active or not. When dlserver is active there is only
> two possible conditions:
> - dlserver is deferred.
> - cfs task is running on behalf of dlserver.
> 
> Signed-off-by: Vineeth Pillai (Google) <vineeth@bitbyteword.org>

Tested-by: Marcel Ziswiler <marcel.ziswiler@codethink.co.uk> # ROCK 5B

> ---
>  kernel/sched/fair.c | 15 +++++++++------
>  1 file changed, 9 insertions(+), 6 deletions(-)
> 
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 2d80aaac4413..f5329672815b 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -1159,8 +1159,6 @@ static inline void update_curr_task(struct task_struct *p, s64 delta_exec)
>  	trace_sched_stat_runtime(p, delta_exec);
>  	account_group_exec_runtime(p, delta_exec);
>  	cgroup_account_cputime(p, delta_exec);
> -	if (p->dl_server)
> -		dl_server_update(p->dl_server, delta_exec);
>  }
>  
>  static inline bool did_preempt_short(struct cfs_rq *cfs_rq, struct sched_entity *curr)
> @@ -1237,11 +1235,16 @@ static void update_curr(struct cfs_rq *cfs_rq)
>  		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 possibly avoid running this period.
> +		 * If the fair_server is active, we need to account for the
> +		 * fair_server time whether or not the task is running on
> +		 * behalf of fair_server or not:
> +		 *  - If the task is running on behalf of fair_server, we need
> +		 *    to limit its time based on the assigned runtime.
> +		 *  - Fair task that runs outside of fair_server should account
> +		 *    against fair_server such that it can account for this time
> +		 *    and possibly avoid running this period.
>  		 */
> -		if (p->dl_server != &rq->fair_server)
> +		if (dl_server_active(&rq->fair_server))
>  			dl_server_update(&rq->fair_server, delta_exec);
>  	}

Cheers

Marcel

  reply	other threads:[~2024-12-13 10:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-13  3:22 [PATCH 1/2] sched/dlserver: flag to represent active status of dlserver Vineeth Pillai (Google)
2024-12-13  3:22 ` [PATCH 2/2] sched/dlserver: fix dlserver time accounting Vineeth Pillai (Google)
2024-12-13 10:10   ` Marcel Ziswiler [this message]
2024-12-14 18:36   ` [tip: sched/urgent] sched/dlserver: Fix " tip-bot2 for Vineeth Pillai (Google)
2024-12-13 10:10 ` [PATCH 1/2] sched/dlserver: flag to represent active status of dlserver Marcel Ziswiler
2024-12-13 12:51 ` Peter Zijlstra
2024-12-13 12:58   ` Ilya Maximets
2024-12-13 14:57   ` Juri Lelli
2024-12-14 18:37 ` [tip: sched/urgent] sched/dlserver: Fix dlserver double enqueue tip-bot2 for Vineeth Pillai (Google)
2024-12-17 16:44 ` [PATCH 1/2] EXP sched/dlserver: flag to represent active status of dlserver Paul E. McKenney
  -- strict thread matches above, loose matches on Subject: below --
2024-12-13  3:21 [PATCH 1/2] " Vineeth Pillai (Google)
2024-12-13  3:21 ` [PATCH 2/2] sched/dlserver: fix dlserver time accounting Vineeth Pillai (Google)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41be49a210d5ef1c48cd0cbfe23a52368cb049b9.camel@codethink.co.uk \
    --to=marcel.ziswiler@codethink.co.uk \
    --cc=i.maximets@ovn.org \
    --cc=joel@joelfernandes.org \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=shraash@google.com \
    --cc=vincent.guittot@linaro.org \
    --cc=vineeth@bitbyteword.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®