* [RESEND PATCH v2] sched/fair: Remove check in idle_balance against migration_cost
@ 2018-03-14 18:36 Rohit Jain
2018-03-16 14:35 ` Peter Zijlstra
0 siblings, 1 reply; 5+ messages in thread
From: Rohit Jain @ 2018-03-14 18:36 UTC (permalink / raw)
To: linux-kernel
Cc: peterz, mingo, steven.sistare, joelaf, jbacik, juri.lelli,
dhaval.giani, efault, riel
Patch "1b9508f6 sched: Rate-limit newidle" reduced the CPU time spent in
idle_balance() by refusing to balance if the average idle time was less
than sysctl_sched_migration_cost. Since then, more refined methods for
reducing CPU time have been added, including dynamic measurement of search
cost in curr_cost and a check for this_rq->rd->overload. The original
check of sysctl_sched_migration_cost is no longer necessary, and is in
fact harmful because it discourages load balancing, so delete it.
1) An internal Oracle RDBMS OLTP test on an 8-socket Exadata shows a 2.2%
gain in throughput.
2) Hackbench results on 2 socket, 44 core and 88 threads Intel x86 machine
(lower is better):
+--------------+-----------------+-------------------------+
| | Without Patch |With Patch |
+------+-------+--------+--------+----------------+--------+
|Loops | Groups|Average |%Std Dev|Average |%Std Dev|
+------+-------+--------+--------+----------------+--------+
|100000| 4 |9.701 |0.78 |8.919 (+8.07%) |1.07 |
|100000| 8 |17.186 |0.77 |17.043 (+0.83%) |0.83 |
|100000| 16 |30.378 |0.55 |29.565 (+2.67%) |0.29 |
|100000| 32 |54.712 |0.54 |52.158 (+4.67%) |0.22 |
+------+-------+--------+--------+----------------+--------+
3) Sysbench MySQL results on 2 socket, 44 core and 88 threads Intel x86
machine (higher is better):
+-------+--------------------+----------------------------+
| | Without Patch | With Patch |
+-------+-----------+--------+-------------------+--------+
|Num | Average | | Average | |
|Threads| throughput|%Std Dev| throughput |%Std Dev|
+-------+-----------+--------+-------------------+--------+
| 8 | 133658.2 | 0.66 | 134232.2 (+0.43%) | 1.29 |
| 16 | 266540 | 0.48 | 268584.6 (+0.77%) | 0.37 |
| 32 | 466315.6 | 0.15 | 468594.2 (+0.49%) | 0.23 |
| 64 | 720039.4 | 0.23 | 717253.8 (-0.39%) | 0.36 |
| 72 | 757284.4 | 0.25 | 764984.0 (+1.02%) | 0.38 |
| 80 | 807955.6 | 0.22 | 831372.2 (+2.90%) | 0.10 |
| 88 | 863173.8 | 0.25 | 887049.0 (+2.77%) | 0.56 |
| 96 | 882950.8 | 0.32 | 892913.8 (+1.13%) | 0.41 |
| 128 | 895112.6 | 0.13 | 901195.0 (+0.68%) | 0.28 |
+-------+-----------+--------+-------------------+--------+
4) tbench sample results on 2 socket, 44 core and 88 threads Intel x86
machine:
With Patch:
Throughput 562.783 MB/sec 2 clients 2 procs max_latency=0.365 ms
Throughput 1394.5 MB/sec 5 clients 5 procs max_latency=0.531 ms
Throughput 2741.27 MB/sec 10 clients 10 procs max_latency=0.692 ms
Throughput 5279.49 MB/sec 20 clients 20 procs max_latency=1.029 ms
Throughput 8529.22 MB/sec 40 clients 40 procs max_latency=1.693 ms
Without patch:
Throughput 557.142 MB/sec 2 clients 2 procs max_latency=0.264 ms
Throughput 1381.59 MB/sec 5 clients 5 procs max_latency=0.335 ms
Throughput 2726.84 MB/sec 10 clients 10 procs max_latency=0.352 ms
Throughput 5230.12 MB/sec 20 clients 20 procs max_latency=1.632 ms
Throughput 8474.5 MB/sec 40 clients 40 procs max_latency=7.756 ms
Signed-off-by: Rohit Jain <rohit.k.jain@oracle.com>
Signed-off-by: Rohit Jain <rohit.k.jain@oracle.com>
---
kernel/sched/fair.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 5eb3ffc..569ea83 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -8804,8 +8804,7 @@ static int idle_balance(struct rq *this_rq, struct rq_flags *rf)
*/
rq_unpin_lock(this_rq, rf);
- if (this_rq->avg_idle < sysctl_sched_migration_cost ||
- !this_rq->rd->overload) {
+ if (!this_rq->rd->overload) {
rcu_read_lock();
sd = rcu_dereference_check_sched_domain(this_rq->sd);
if (sd)
--
2.7.4
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [RESEND PATCH v2] sched/fair: Remove check in idle_balance against migration_cost
2018-03-14 18:36 [RESEND PATCH v2] sched/fair: Remove check in idle_balance against migration_cost Rohit Jain
@ 2018-03-16 14:35 ` Peter Zijlstra
2018-03-16 17:21 ` Rohit Jain
0 siblings, 1 reply; 5+ messages in thread
From: Peter Zijlstra @ 2018-03-16 14:35 UTC (permalink / raw)
To: Rohit Jain
Cc: linux-kernel, mingo, steven.sistare, joelaf, jbacik, juri.lelli,
dhaval.giani, efault, riel
On Wed, Mar 14, 2018 at 11:36:47AM -0700, Rohit Jain wrote:
> Signed-off-by: Rohit Jain <rohit.k.jain@oracle.com>
>
> Signed-off-by: Rohit Jain <rohit.k.jain@oracle.com>
Surely you only need a single on of those.
> ---
> kernel/sched/fair.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 5eb3ffc..569ea83 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -8804,8 +8804,7 @@ static int idle_balance(struct rq *this_rq, struct rq_flags *rf)
> */
> rq_unpin_lock(this_rq, rf);
>
> - if (this_rq->avg_idle < sysctl_sched_migration_cost ||
> - !this_rq->rd->overload) {
> + if (!this_rq->rd->overload) {
> rcu_read_lock();
> sd = rcu_dereference_check_sched_domain(this_rq->sd);
> if (sd)
I don't think that actually works right on the current tree. In
particular look at commit:
31e77c93e432 ("sched/fair: Update blocked load when newly idle")
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [RESEND PATCH v2] sched/fair: Remove check in idle_balance against migration_cost
2018-03-16 14:35 ` Peter Zijlstra
@ 2018-03-16 17:21 ` Rohit Jain
2018-03-16 17:42 ` Peter Zijlstra
0 siblings, 1 reply; 5+ messages in thread
From: Rohit Jain @ 2018-03-16 17:21 UTC (permalink / raw)
To: Peter Zijlstra
Cc: linux-kernel, mingo, steven.sistare, joelaf, jbacik, juri.lelli,
dhaval.giani, efault, riel
Hi Peter,
On 03/16/2018 07:35 AM, Peter Zijlstra wrote:
> On Wed, Mar 14, 2018 at 11:36:47AM -0700, Rohit Jain wrote:
>> Signed-off-by: Rohit Jain <rohit.k.jain@oracle.com>
>>
>> Signed-off-by: Rohit Jain <rohit.k.jain@oracle.com>
> Surely you only need a single on of those.
Oh wow! I don't know how I missed this :) Thanks!
>> ---
>> kernel/sched/fair.c | 3 +--
>> 1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
>> index 5eb3ffc..569ea83 100644
>> --- a/kernel/sched/fair.c
>> +++ b/kernel/sched/fair.c
>> @@ -8804,8 +8804,7 @@ static int idle_balance(struct rq *this_rq, struct rq_flags *rf)
>> */
>> rq_unpin_lock(this_rq, rf);
>>
>> - if (this_rq->avg_idle < sysctl_sched_migration_cost ||
>> - !this_rq->rd->overload) {
>> + if (!this_rq->rd->overload) {
>> rcu_read_lock();
>> sd = rcu_dereference_check_sched_domain(this_rq->sd);
>> if (sd)
> I don't think that actually works right on the current tree. In
> particular look at commit:
>
> 31e77c93e432 ("sched/fair: Update blocked load when newly idle")
OK. I see from LKML the code has moved.
However, when I clone from
https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/
I cannot see the commit.
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [RESEND PATCH v2] sched/fair: Remove check in idle_balance against migration_cost
2018-03-16 17:21 ` Rohit Jain
@ 2018-03-16 17:42 ` Peter Zijlstra
2018-03-16 18:14 ` Rohit Jain
0 siblings, 1 reply; 5+ messages in thread
From: Peter Zijlstra @ 2018-03-16 17:42 UTC (permalink / raw)
To: Rohit Jain
Cc: linux-kernel, mingo, steven.sistare, joelaf, jbacik, juri.lelli,
dhaval.giani, efault, riel
On Fri, Mar 16, 2018 at 10:21:54AM -0700, Rohit Jain wrote:
> Hi Peter,
>
> On 03/16/2018 07:35 AM, Peter Zijlstra wrote:
> > On Wed, Mar 14, 2018 at 11:36:47AM -0700, Rohit Jain wrote:
> > > Signed-off-by: Rohit Jain <rohit.k.jain@oracle.com>
> > >
> > > Signed-off-by: Rohit Jain <rohit.k.jain@oracle.com>
> > Surely you only need a single on of those.
>
> Oh wow! I don't know how I missed this :) Thanks!
> However, when I clone from
> https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/
> I cannot see the commit.
You need to look at:
https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/
my queue.git is the sporadic push of my quilt tree on top of that.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [RESEND PATCH v2] sched/fair: Remove check in idle_balance against migration_cost
2018-03-16 17:42 ` Peter Zijlstra
@ 2018-03-16 18:14 ` Rohit Jain
0 siblings, 0 replies; 5+ messages in thread
From: Rohit Jain @ 2018-03-16 18:14 UTC (permalink / raw)
To: Peter Zijlstra
Cc: linux-kernel, mingo, steven.sistare, joelaf, jbacik, juri.lelli,
dhaval.giani, efault, riel
On 03/16/2018 10:42 AM, Peter Zijlstra wrote:
<snip>
> You need to look at:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/
>
> my queue.git is the sporadic push of my quilt tree on top of that.
Thanks found it! I will re-test and send v3 as needed.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-03-16 18:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-14 18:36 [RESEND PATCH v2] sched/fair: Remove check in idle_balance against migration_cost Rohit Jain
2018-03-16 14:35 ` Peter Zijlstra
2018-03-16 17:21 ` Rohit Jain
2018-03-16 17:42 ` Peter Zijlstra
2018-03-16 18:14 ` Rohit Jain
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®