Skip to contentSkip to conversation

sched/deadline: don't need to check SD_BALANCE_FORK

PATCH In review Wanpeng Li 4 participants 10 messages Oct 14, 2014 – Oct 28, 2014 Scheduler

lore
Share & tools
lore

Wanpeng Li

author
#0 lore raw

PATCH 1/2 sched/deadline: don't need to check SD_BALANCE_FORK

There is no need to do balance during fork since SCHED_DEADLINE tasks can't fork. This patch avoid the SD_BALANCE_FORK check.

---
 kernel/sched/deadline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/deadline.c +1 -1
index abfaf3d..f46b7f1 100644
@@ -914,7 +914,7 @@ select_task_rq_dl(struct task_struct *p, int cpu, int sd_flag, int flags)
 	struct task_struct *curr;
 	struct rq *rq;
 
-	if (sd_flag != SD_BALANCE_WAKE && sd_flag != SD_BALANCE_FORK)
+	if (sd_flag != SD_BALANCE_WAKE)
 		goto out;
 
 	rq = cpu_rq(cpu);
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH 2/2 sched/deadline: don't need to balance during wakeup if wakee is pinned

Use nr_cpus_allowed to bail from select_task_rq() when only one cpu can be used, and saves some cycles for pinned tasks.

---
 kernel/sched/deadline.c | 3 +++
 1 file changed, 3 insertions(+)
kernel/sched/deadline.c +3 -0
index f46b7f1..5874bf8 100644
@@ -914,6 +914,9 @@ select_task_rq_dl(struct task_struct *p, int cpu, int sd_flag, int flags)
 	struct task_struct *curr;
 	struct rq *rq;
 
+	if (p->nr_cpus_allowed == 1)
+		goto out;
+
 	if (sd_flag != SD_BALANCE_WAKE)
 		goto out;
 
Signature · 1 line
1.9.1
#2 lore raw

Re: [PATCH 2/2] sched/deadline: don't need to balance during wakeup if wakee is pinned

Cc Juri,

Quoted 22 lines · Wanpeng Li

Use nr_cpus_allowed to bail from select_task_rq() when only one cpu can be used, and saves some cycles for pinned tasks.

---
 kernel/sched/deadline.c | 3 +++
 1 file changed, 3 insertions(+)
kernel/sched/deadline.c +3 -0
index f46b7f1..5874bf8 100644
@@ -914,6 +914,9 @@ select_task_rq_dl(struct task_struct *p, int cpu, int sd_flag, int flags)
 	struct task_struct *curr;
 	struct rq *rq;
 
+	if (p->nr_cpus_allowed == 1)
+		goto out;
+
 	if (sd_flag != SD_BALANCE_WAKE)
 		goto out;
 
#3 lore raw

Re: [PATCH 2/2] sched/deadline: don't need to balance during wakeup if wakee is pinned

Hi,

Quoted 19 lines · Wanpeng Li

Cc Juri,

Quoted 16 lines · Wanpeng Li

Use nr_cpus_allowed to bail from select_task_rq() when only one cpu can be used, and saves some cycles for pinned tasks.

---
 kernel/sched/deadline.c | 3 +++
 1 file changed, 3 insertions(+)
kernel/sched/deadline.c +0 -0
index f46b7f1..5874bf8 100644
@@ -914,6 +914,9 @@ select_task_rq_dl(struct task_struct *p, int cpu, int sd_flag, int flags)
 	struct task_struct *curr;
 	struct rq *rq;
 
Quoted 6 lines

kernel/sched/deadline.c select_task_rq_dl(struct task_struct *p, int cpu, int sd_flag, int flags) · line 922

Quoted 6 lines
kernel/sched/deadline.c +3 -0
+	if (p->nr_cpus_allowed == 1)
+		goto out;
+
 	if (sd_flag != SD_BALANCE_WAKE)
 		goto out;
 

Apart from the encoding of the resend, it looks good, thanks!

Best,

- Juri

#4 lore raw

Re: [PATCH 2/2] sched/deadline: don't need to balance during wakeup if wakee is pinned

Hi Juri,

Quoted 22 lines · Juri Lelli

Hi,

Quoted 19 lines · Wanpeng Li

Cc Juri,

Quoted 16 lines · Wanpeng Li

Use nr_cpus_allowed to bail from select_task_rq() when only one cpu can be used, and saves some cycles for pinned tasks.

---
  kernel/sched/deadline.c | 3 +++
  1 file changed, 3 insertions(+)
kernel/sched/deadline.c +0 -0
index f46b7f1..5874bf8 100644
@@ -914,6 +914,9 @@ select_task_rq_dl(struct task_struct *p, int cpu, int sd_flag, int flags)
  	struct task_struct *curr;
  	struct rq *rq;
 
Quoted 7 lines
Quoted 6 lines

kernel/sched/deadline.c select_task_rq_dl(struct task_struct *p, int cpu, int sd_flag, int flags) · line 922

Quoted 6 lines
kernel/sched/deadline.c +3 -0
+	if (p->nr_cpus_allowed == 1)
+		goto out;
+
  	if (sd_flag != SD_BALANCE_WAKE)
  		goto out;
 

Apart from the encoding of the resend, it looks good, thanks!

What's your meaning of resend? Do you mean this one?

https://lkml.org/lkml/2014/10/10/425

I'm afraid they are different patches.

Regards,
Wanpeng Li

Quoted 5 lines

Best,

- Juri

#5 lore raw

Re: [PATCH 2/2] sched/deadline: don't need to balance during wakeup if wakee is pinned

Quoted 33 lines · Wanpeng Li

Hi Juri,

Quoted 22 lines · Juri Lelli

Hi,

Quoted 19 lines · Wanpeng Li

Cc Juri,

Quoted 16 lines · Wanpeng Li

Use nr_cpus_allowed to bail from select_task_rq() when only one cpu can be used, and saves some cycles for pinned tasks.

---
  kernel/sched/deadline.c | 3 +++
  1 file changed, 3 insertions(+)
kernel/sched/deadline.c +0 -0
index f46b7f1..5874bf8 100644
@@ -914,6 +914,9 @@ select_task_rq_dl(struct task_struct *p, int cpu, int sd_flag, int flags)
  	struct task_struct *curr;
  	struct rq *rq;
 
Quoted 7 lines
Quoted 6 lines

kernel/sched/deadline.c select_task_rq_dl(struct task_struct *p, int cpu, int sd_flag, int flags) · line 922

Quoted 6 lines
kernel/sched/deadline.c +3 -0
+	if (p->nr_cpus_allowed == 1)
+		goto out;
+
  	if (sd_flag != SD_BALANCE_WAKE)
  		goto out;
 

Apart from the encoding of the resend, it looks good, thanks!

Quoted 1 line

What's your meaning of resend? Do you mean this one?

Nope. I just meant that I received your "Cc Juri" encoded as Chinese Simplified. But, I guess the original lkml patch looks good. Sorry for the confusion :).

Best,

- Juri

Quoted 15 lines

https://lkml.org/lkml/2014/10/10/425

I'm afraid they are different patches.

Regards,
Wanpeng Li

Quoted 5 lines

Best,

- Juri

#6 lore raw

[tip:sched/core] sched/deadline: Don' t balance during wakeup if wakee is pinned

In reply to Wanpeng Li
sched/deadline: Don't balance during wakeup if wakee is pinned
Commit-ID:  f4e9d94a5bf60193d45f92b136e3d166be3ec8d5
Gitweb:     http://git.kernel.org/tip/f4e9d94a5bf60193d45f92b136e3d166be3ec8d5
Author:     Wanpeng Li <[email protected]>
AuthorDate: Tue, 14 Oct 2014 10:22:40 +0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 28 Oct 2014 10:48:02 +0100

sched/deadline: Don't balance during wakeup if wakee is pinned

Use nr_cpus_allowed to bail from select_task_rq() when only one cpu can be used, and saves some cycles for pinned tasks.

---
 kernel/sched/deadline.c | 3 +++
 1 file changed, 3 insertions(+)
kernel/sched/deadline.c +3 -0
index fab3bf8..2e31a30 100644
@@ -933,6 +933,9 @@ select_task_rq_dl(struct task_struct *p, int cpu, int sd_flag, int flags)
 	struct task_struct *curr;
 	struct rq *rq;
 
+	if (p->nr_cpus_allowed == 1)
+		goto out;
+
 	if (sd_flag != SD_BALANCE_WAKE)
 		goto out;
 
#7 lore raw
In reply to Wanpeng Li

Cc Juri,

Quoted 21 lines · Wanpeng Li

There is no need to do balance during fork since SCHED_DEADLINE tasks can't fork. This patch avoid the SD_BALANCE_FORK check.

---
 kernel/sched/deadline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/deadline.c +1 -1
index abfaf3d..f46b7f1 100644
@@ -914,7 +914,7 @@ select_task_rq_dl(struct task_struct *p, int cpu, int sd_flag, int flags)
 	struct task_struct *curr;
 	struct rq *rq;
 
-	if (sd_flag != SD_BALANCE_WAKE && sd_flag != SD_BALANCE_FORK)
+	if (sd_flag != SD_BALANCE_WAKE)
 		goto out;
 
 	rq = cpu_rq(cpu);
#8 lore raw

Hi,

Quoted 19 lines · Wanpeng Li

Cc Juri,

Quoted 16 lines · Wanpeng Li

There is no need to do balance during fork since SCHED_DEADLINE tasks can't fork. This patch avoid the SD_BALANCE_FORK check.

---
 kernel/sched/deadline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/deadline.c +0 -0
index abfaf3d..f46b7f1 100644
@@ -914,7 +914,7 @@ select_task_rq_dl(struct task_struct *p, int cpu, int sd_flag, int flags)
 	struct task_struct *curr;
 	struct rq *rq;
 
Quoted 5 lines

kernel/sched/deadline.c select_task_rq_dl(struct task_struct *p, int cpu, int sd_flag, int flags) · line 920

Quoted 5 lines
kernel/sched/deadline.c +1 -1
-	if (sd_flag != SD_BALANCE_WAKE && sd_flag != SD_BALANCE_FORK)
+	if (sd_flag != SD_BALANCE_WAKE)
 		goto out;
 
 	rq = cpu_rq(cpu);

Yes, makes sense.

Thanks,

- Juri

#9 lore raw

[tip:sched/core] sched/deadline: Don't check SD_BALANCE_FORK

In reply to Wanpeng Li
sched/deadline: Don't check SD_BALANCE_FORK
Commit-ID:  1d7e974cbf2fce2683f34ff33c173fd7ef5478c7
Gitweb:     http://git.kernel.org/tip/1d7e974cbf2fce2683f34ff33c173fd7ef5478c7
Author:     Wanpeng Li <[email protected]>
AuthorDate: Tue, 14 Oct 2014 10:22:39 +0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Tue, 28 Oct 2014 10:48:01 +0100

sched/deadline: Don't check SD_BALANCE_FORK

There is no need to do balance during fork since SCHED_DEADLINE tasks can't fork. This patch avoid the SD_BALANCE_FORK check.

---
 kernel/sched/deadline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/deadline.c +1 -1
index 8aaa971..fab3bf8 100644
@@ -933,7 +933,7 @@ select_task_rq_dl(struct task_struct *p, int cpu, int sd_flag, int flags)
 	struct task_struct *curr;
 	struct rq *rq;
 
-	if (sd_flag != SD_BALANCE_WAKE && sd_flag != SD_BALANCE_FORK)
+	if (sd_flag != SD_BALANCE_WAKE)
 		goto out;
 
 	rq = cpu_rq(cpu);