LKML Archive on lore.kernel.org
 help / color / Atom feed
From: Kirill Tkhai <ktkhai@parallels.com>
To: <linux-kernel@vger.kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>, <tkhai@yandex.ru>
Subject: [PATCH 5/5] sched/dl: Simplify pick_dl_task()
Date: Fri, 12 Sep 2014 17:42:20 +0400
Message-ID: <1410529340.3569.27.camel@tkhai> (raw)
In-Reply-To: <20140912132709.26840.4893.stgit@tkhai>


1)Nobody calls pick_dl_task with negative cpu, it's old RT leftover.

2)If p->nr_cpus_allowed is 1, than the affinity has just been changed
in set_cpus_allowed_ptr(); we'll pick it just earlier than migration
thread.

Signed-off-by: Kirill Tkhai <ktkhai@parallels.com>
---
 kernel/sched/deadline.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
index cc4eb89..aaa5abb 100644
--- a/kernel/sched/deadline.c
+++ b/kernel/sched/deadline.c
@@ -1121,10 +1121,8 @@ static void set_curr_task_dl(struct rq *rq)
 static int pick_dl_task(struct rq *rq, struct task_struct *p, int cpu)
 {
 	if (!task_running(rq, p) &&
-	    (cpu < 0 || cpumask_test_cpu(cpu, &p->cpus_allowed)) &&
-	    (p->nr_cpus_allowed > 1))
+	    cpumask_test_cpu(cpu, tsk_cpus_allowed(p)))
 		return 1;
-
 	return 0;
 }
 




  parent reply index

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20140912132709.26840.4893.stgit@tkhai>
2014-09-12 13:40 ` [PATCH 1/5] cleanup, treewide: Remove set_current_state(TASK_RUNNING) after schedule Kirill Tkhai
2014-09-19 11:44   ` [tip:sched/core] sched, cleanup, treewide: Remove set_current_state(TASK_RUNNING) after schedule() tip-bot for Kirill Tkhai
2014-09-12 13:41 ` [PATCH 2/5] sched/fair: cleanup: Remove useless assignment in select_task_rq_fair() Kirill Tkhai
2014-09-19 11:45   ` [tip:sched/core] " tip-bot for Kirill Tkhai
2014-09-12 13:41 ` [PATCH 3/5] sched/core: Use put_prev_task() accessor where possible Kirill Tkhai
2014-09-19 11:45   ` [tip:sched/core] " tip-bot for Kirill Tkhai
2014-09-12 13:42 ` [PATCH 4/5] sched/rt: Remove useless if from cleanup pick_next_task_rt() Kirill Tkhai
2014-09-19 11:45   ` [tip:sched/core] " tip-bot for Kirill Tkhai
2014-09-12 13:42 ` Kirill Tkhai [this message]
2014-09-19 11:46   ` [tip:sched/core] sched/dl: Simplify pick_dl_task() tip-bot for Kirill Tkhai

Reply instructions:

You may reply publically 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=1410529340.3569.27.camel@tkhai \
    --to=ktkhai@parallels.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tkhai@yandex.ru \
    /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

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git