linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: Vincent Guittot <vincent.guittot@linaro.org>
Cc: peterz@infradead.org, mgorman@suse.de,
	valentin.schneider@arm.com, parth@linux.ibm.com,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 5/8] sched/fair: Take into account latency priority at wakeup
Date: Fri, 16 Sep 2022 20:02:45 +0800	[thread overview]
Message-ID: <20220916120245.2951-1-hdanton@sina.com> (raw)
In-Reply-To: <20220916080305.29574-6-vincent.guittot@linaro.org>

Hello Vincent 

On 16 Sep 2022 10:03:02 +0200 Vincent Guittot <vincent.guittot@linaro.org> wrote:
> 
> @@ -4606,6 +4608,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr)
>  
>  	se = __pick_first_entity(cfs_rq);
>  	delta = curr->vruntime - se->vruntime;
> +	delta -= wakeup_latency_gran(curr, se);
>  
>  	if (delta < 0)
>  		return;

What is derived from the latency nice you added is the runtime granulaity
which has a role in preempting the current task.

Given the same defination of latency nice as the nice, the runtime granularity
can be computed without introducing the latency nice.

Only for thoughts now.

Hillf

+++ b/kernel/sched/fair.c
@@ -4569,7 +4569,7 @@ dequeue_entity(struct cfs_rq *cfs_rq, st
 static void
 check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr)
 {
-	unsigned long ideal_runtime, delta_exec;
+	unsigned long ideal_runtime, delta_exec, granu;
 	struct sched_entity *se;
 	s64 delta;
 
@@ -4594,6 +4594,14 @@ check_preempt_tick(struct cfs_rq *cfs_rq
 		return;
 
 	se = __pick_first_entity(cfs_rq);
+
+	granu = sysctl_sched_min_granularity +
+		(ideal_runtime - sysctl_sched_min_granularity) *
+		(se->latency_nice + 20) / LATENCY_NICE_WIDTH;
+
+	if (delta_exec < granu)
+		return;
+
 	delta = curr->vruntime - se->vruntime;
 
 	if (delta < 0)


       reply	other threads:[~2022-09-16 12:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20220916080305.29574-6-vincent.guittot@linaro.org>
2022-09-16 12:02 ` Hillf Danton [this message]
2022-09-16 13:36   ` Vincent Guittot
2022-09-17 22:58     ` Hillf Danton
2022-09-18 10:46       ` Vincent Guittot
2022-09-20 11:32         ` Hillf Danton
2022-09-20 15:17           ` Vincent Guittot

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=20220916120245.2951-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=parth@linux.ibm.com \
    --cc=peterz@infradead.org \
    --cc=valentin.schneider@arm.com \
    --cc=vincent.guittot@linaro.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