All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juri Lelli <juri.lelli@arm.com>
To: Wanpeng Li <wanpeng.li@linux.intel.com>,
	Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"juri.lelli@gmail.com" <juri.lelli@gmail.com>
Subject: Re: [PATCH 5/6] sched/dl: reschedule if successfully pull earlier deadline task
Date: Thu, 30 Oct 2014 10:21:00 +0000	[thread overview]
Message-ID: <5452110C.40108@arm.com> (raw)
In-Reply-To: <1414374067-7209-5-git-send-email-wanpeng.li@linux.intel.com>

Hi,

On 27/10/14 01:41, Wanpeng Li wrote:
> Reschedule if successfully pull earlier deadline task.
> 
> Signed-off-by: Wanpeng Li <wanpeng.li@linux.intel.com>
> ---
>  kernel/sched/deadline.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index 97141e2..21de865 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -1583,8 +1583,8 @@ static void switched_from_dl(struct rq *rq, struct task_struct *p)
>  	 * this is the right place to try to pull some other one
>  	 * from an overloaded cpu, if any.
>  	 */
> -	if (!rq->dl.dl_nr_running)
> -		pull_dl_task(rq);
> +	if (!rq->dl.dl_nr_running && pull_dl_task(rq))
> +			resched_curr(rq);

Right, we have to reschedule. But, how about we fully align to -rt?

Peter, is the task_on_rq_queued() check for cases in which p is not
enqueued but its class changes after a setscheduler/rt_mutex_setprio?

Thanks,

- Juri

>From 404749782e493cb6019193f347163b640ebd552d Mon Sep 17 00:00:00 2001
From: Juri Lelli <juri.lelli@arm.com>
Date: Thu, 30 Oct 2014 10:15:40 +0000
Subject: [PATCH] sched/deadline: reschedule from switched_from_dl() after a
 successful pull

In switched_from_dl() we have to issue a resched if we
successfully pulled some task from other cpus.
This patch also aligns the behaviour with -rt.

Signed-off-by: Juri Lelli <juri.lelli@arm.com>
Suggested-by: Wanpeng Li <wanpeng.li@linux.intel.com>
---
 kernel/sched/deadline.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index db6ad38..e8943fc 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1623,8 +1623,11 @@ static void switched_from_dl(struct rq *rq, struct task_struct *p)
 	 * this is the right place to try to pull some other one
 	 * from an overloaded cpu, if any.
 	 */
-	if (!rq->dl.dl_nr_running)
-		pull_dl_task(rq);
+	if (!task_on_rq_queued(p) || rq->dl.dl_nr_running)
+		return;
+
+	if (pull_dl_task(rq))
+		resched_curr(rq);
 #endif
 }
 
-- 
2.1.2


  parent reply	other threads:[~2014-10-30 10:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-27  1:41 [PATCH 1/6] sched/rt: check if curr can be pushed/pulled somewhere else in advance Wanpeng Li
2014-10-27  1:41 ` [PATCH 2/6] sched/dl: fix yield task artificial overrun Wanpeng Li
2014-10-29 16:33   ` Juri Lelli
2014-10-29 22:49     ` Wanpeng Li
2014-10-30 10:04       ` Juri Lelli
2014-10-27  1:41 ` [PATCH 3/6] sched/dl: add deadline rq status print Wanpeng Li
2014-10-29 16:52   ` Juri Lelli
2014-10-29 22:52     ` Wanpeng Li
2014-10-27  1:41 ` [PATCH 4/6] sched/dl: push task away if the deadline is equal to curr during wakeup Wanpeng Li
2014-10-29 17:08   ` Juri Lelli
2014-10-27  1:41 ` [PATCH 5/6] sched/dl: reschedule if successfully pull earlier deadline task Wanpeng Li
2014-10-29 22:59   ` Wanpeng Li
2014-10-30 10:21   ` Juri Lelli [this message]
2014-10-30 13:12     ` Wanpeng Li
2014-10-30 14:42       ` Juri Lelli
2014-10-31 15:37     ` Peter Zijlstra
2014-10-27  1:41 ` [PATCH 6/6] sched/dl: don't check CONFIG_SMP in switched_from_dl Wanpeng Li
2014-10-30 10:29   ` Juri Lelli
2014-10-29 22:57 ` [PATCH 1/6] sched/rt: check if curr can be pushed/pulled somewhere else in advance Wanpeng Li

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=5452110C.40108@arm.com \
    --to=juri.lelli@arm.com \
    --cc=juri.lelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=wanpeng.li@linux.intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.