All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kirill Tkhai <ktkhai@parallels.com>
To: Wanpeng Li <wanpeng.li@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@arm.com>, <juri.lelli@gmail.com>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/6] sched/rt: check if curr can be pushed/pulled somewhere else in advance
Date: Thu, 30 Oct 2014 18:01:05 +0300	[thread overview]
Message-ID: <1414681265.8574.83.camel@tkhai> (raw)
In-Reply-To: <1414678623-13576-1-git-send-email-wanpeng.li@linux.intel.com>

Hi,

В Чт, 30/10/2014 в 22:16 +0800, Wanpeng Li пишет:
> This patch checks if current can be pushed/pulled somewhere else 
> in advance to make logic clear, the same behavior as rt class.
> 
> - If current can't be migrated, useless to reschedule, let's hope 
>   task can move out.
> - If task is migratable, so let's not schedule it and see if it 
>   can be pushed or pulled somewhere else.

No functional changes, are they? So I'd suggest to change subject
on something connected with "cleanup".

Also, the description confuses. Please, write that code was cleaned
up, and that comments were added.

> Signed-off-by: Wanpeng Li <wanpeng.li@linux.intel.com>
> ---
>  kernel/sched/rt.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
> index d024e6c..a0b51aa 100644
> --- a/kernel/sched/rt.c
> +++ b/kernel/sched/rt.c
> @@ -1351,16 +1351,22 @@ out:
>  
>  static void check_preempt_equal_prio(struct rq *rq, struct task_struct *p)
>  {
> -	if (rq->curr->nr_cpus_allowed == 1)
> +	/*
> +	 * Current can't be migrated, useless to reschedule,
> +	 * let's hope p can move out.
> +	 */
> +	if (rq->curr->nr_cpus_allowed == 1 ||
> +		!cpupri_find(&rq->rd->cpupri, rq->curr, NULL))
>  		return;

All conditions of multi-line if() should be aligned the same:

+	if (rq->curr->nr_cpus_allowed == 1 ||
+	    !cpupri_find(&rq->rd->cpupri, rq->curr, NULL))

>  
> +	/*
> +	 * p is migratable, so let's not schedule it and
> +	 * see if it is pushed or pulled somewhere else.
> +	 */
>  	if (p->nr_cpus_allowed != 1
>  	    && cpupri_find(&rq->rd->cpupri, p, NULL))
>  		return;
>  
> -	if (!cpupri_find(&rq->rd->cpupri, rq->curr, NULL))
> -		return;
> -
>  	/*
>  	 * There appears to be other cpus that can accept
>  	 * current and none to run 'p', so lets reschedule

Thanks,
Kirill



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

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-30 14:16 [PATCH v2 1/6] sched/rt: check if curr can be pushed/pulled somewhere else in advance Wanpeng Li
2014-10-30 14:16 ` [PATCH v2 2/6] sched/deadline: fix artificial overrun introduced by yield_task_dl Wanpeng Li
2014-10-30 14:17 ` [PATCH v2 3/6] sched/dl: add deadline rq status print Wanpeng Li
2014-10-30 14:17 ` [PATCH v2 4/6] sched/dl: push task away if the deadline is equal to curr during wakeup Wanpeng Li
2014-10-30 14:17 ` [PATCH v2 5/6] sched/deadline: reschedule from switched_from_dl() after a successful pull Wanpeng Li
2014-10-30 14:17 ` [PATCH v2 6/6] sched/dl: don't check CONFIG_SMP in switched_from_dl Wanpeng Li
2014-10-30 15:01 ` Kirill Tkhai [this message]
2014-10-30 21:59   ` [PATCH v2 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=1414681265.8574.83.camel@tkhai \
    --to=ktkhai@parallels.com \
    --cc=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.