mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Daniel Bristot de Oliveira <bristot@kernel.org>
Cc: Ingo Molnar <mingo@redhat.com>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>,
	Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Daniel Bristot de Oliveira <bristot@redhat.com>,
	Valentin Schneider <vschneid@redhat.com>,
	linux-kernel@vger.kernel.org,
	Luca Abeni <luca.abeni@santannapisa.it>,
	Tommaso Cucinotta <tommaso.cucinotta@santannapisa.it>,
	Thomas Gleixner <tglx@linutronix.de>,
	Joel Fernandes <joel@joelfernandes.org>,
	Vineeth Pillai <vineeth@bitbyteword.org>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Phil Auld <pauld@redhat.com>,
	Suleiman Souhlal <suleiman@google.com>,
	Youssef Esmat <youssefesmat@google.com>
Subject: Re: [PATCH V6 1/6] sched/fair: Add trivial fair server
Date: Wed, 10 Apr 2024 19:24:23 +0200	[thread overview]
Message-ID: <20240410172423.GB30852@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <d1e02419599172f4045a4711b9ff78081f568bb8.1712337227.git.bristot@kernel.org>

On Fri, Apr 05, 2024 at 07:28:00PM +0200, Daniel Bristot de Oliveira wrote:
> From: Peter Zijlstra <peterz@infradead.org>
> 
> Use deadline servers to service fair tasks.
> 
> This patch adds a fair_server deadline entity which acts as a container
> for fair entities and can be used to fix starvation when higher priority
> (wrt fair) tasks are monopolizing CPU(s).
> 
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> Signed-off-by: Daniel Bristot de Oliveira <bristot@kernel.org>
> ---
>  kernel/sched/core.c     | 24 ++++++++++++++++--------
>  kernel/sched/deadline.c | 23 +++++++++++++++++++++++
>  kernel/sched/fair.c     | 25 +++++++++++++++++++++++++
>  kernel/sched/sched.h    |  4 ++++
>  4 files changed, 68 insertions(+), 8 deletions(-)
> 
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 7019a40457a6..04e2270487b7 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -6007,6 +6007,14 @@ static void put_prev_task_balance(struct rq *rq, struct task_struct *prev,
>  #endif
>  
>  	put_prev_task(rq, prev);
> +
> +	/*
> +	 * We've updated @prev and no longer need the server link, clear it.
> +	 * Must be done before ->pick_next_task() because that can (re)set
> +	 * ->dl_server.
> +	 */
> +	if (prev->dl_server)
> +		prev->dl_server = NULL;
>  }
>  
>  /*
> @@ -6037,6 +6045,13 @@ __pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf)
>  			p = pick_next_task_idle(rq);
>  		}
>  
> +		/*
> +		 * This is a normal CFS pick, but the previous could be a DL pick.
> +		 * Clear it as previous is no longer picked.
> +		 */
> +		if (prev->dl_server)
> +			prev->dl_server = NULL;
> +
>  		/*
>  		 * This is the fast path; it cannot be a DL server pick;
>  		 * therefore even if @p == @prev, ->dl_server must be NULL.
> @@ -6050,14 +6065,6 @@ __pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf)
>  restart:
>  	put_prev_task_balance(rq, prev, rf);
>  
> -	/*
> -	 * We've updated @prev and no longer need the server link, clear it.
> -	 * Must be done before ->pick_next_task() because that can (re)set
> -	 * ->dl_server.
> -	 */
> -	if (prev->dl_server)
> -		prev->dl_server = NULL;
> -
>  	for_each_class(class) {
>  		p = class->pick_next_task(rq);
>  		if (p)

This bit seems like a fix for 63ba8422f876 ("sched/deadline: Introduce
deadline servers"), should it be a separate patch?

  reply	other threads:[~2024-04-10 17:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-05 17:27 [PATCH V6 0/6] SCHED_DEADLINE server infrastructure Daniel Bristot de Oliveira
2024-04-05 17:28 ` [PATCH V6 1/6] sched/fair: Add trivial fair server Daniel Bristot de Oliveira
2024-04-10 17:24   ` Peter Zijlstra [this message]
2024-04-11  7:28     ` Daniel Bristot de Oliveira
2024-04-05 17:28 ` [PATCH V6 2/6] sched/deadline: Deferrable dl server Daniel Bristot de Oliveira
2024-04-10 17:47   ` Peter Zijlstra
2024-04-11  7:57     ` Daniel Bristot de Oliveira
2024-05-02  8:35     ` Daniel Bristot de Oliveira
2024-05-02  8:45       ` Peter Zijlstra
2024-04-05 17:28 ` [PATCH V6 3/6] sched/fair: Fair server interface Daniel Bristot de Oliveira
2024-04-11 14:43   ` Peter Zijlstra
2024-04-11 15:02     ` Daniel Bristot de Oliveira
2024-04-12  7:43       ` Peter Zijlstra
2024-04-12  8:27         ` Daniel Bristot de Oliveira
2024-04-05 17:32 ` [PATCH V6 4/6] sched/core: Fix priority checking for DL server picks Daniel Bristot de Oliveira
2024-04-05 17:33 ` [PATCH V6 5/6] sched/core: Fix picking of tasks for core scheduling with DL server Daniel Bristot de Oliveira
2024-04-05 17:33 ` [PATCH V6 6/6] sched/rt: Remove default bandwidth control Daniel Bristot de Oliveira

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=20240410172423.GB30852@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bristot@kernel.org \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=joel@joelfernandes.org \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.abeni@santannapisa.it \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=pauld@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=skhan@linuxfoundation.org \
    --cc=suleiman@google.com \
    --cc=tglx@linutronix.de \
    --cc=tommaso.cucinotta@santannapisa.it \
    --cc=vincent.guittot@linaro.org \
    --cc=vineeth@bitbyteword.org \
    --cc=vschneid@redhat.com \
    --cc=youssefesmat@google.com \
    /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®