public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mukesh Kumar Chaurasiya <mchauras@linux.ibm.com>
To: zhangqiao22@huawei.com, mchauras@hotmail.com
Cc: Markus.Elfring@web.de, bristot@redhat.com, bsegall@google.com,
	dietmar.eggemann@arm.com, juri.lelli@redhat.com,
	linux-kernel@vger.kernel.org, mgorman@suse.de, mingo@redhat.com,
	peterz@infradead.org, rostedt@goodmis.org,
	vincent.guittot@linaro.org, vschneid@redhat.com,
	Mukesh Kumar Chaurasiya <mchauras@linux.ibm.com>
Subject: Re: [PATCH v2] sched: Initialize the vruntime of a new task when it is first enqueued
Date: Mon,  1 Jul 2024 21:25:08 +0530	[thread overview]
Message-ID: <171984853311.154200.2041889183083175576.b4-ty@linux.ibm.com> (raw)
In-Reply-To: <20240627133359.1370598-1-zhangqiao22@huawei.com>


On Thu, 27 Jun 2024 21:33:59 +0800, Zhang Qiao wrote:
> When creating a new task, we initialize vruntime of the newly task at
> sched_cgroup_fork(). However, the timing of executing this action is too
> early and may not be accurate.
> 
> Because it uses current CPU to init the vruntime, but the new task
> actually runs on the cpu which be assigned at wake_up_new_task().
> 
> [...]

I tried this on a 104 cpu ppc64le Power9 system

The experiment was to stress the cpus with 416 threads(4 * nproc)
and then run small commands like date, time, ls etc

With bpf i collected the time it took for the tasks from waking up
to switching on to the cpu.

I collected 3600 samples for each

The results are as follows:

With patch

@: count 3601, average 4609830, total 16599997845

@c: 3709
@latency: 
[4K, 8K)               1 |                                                    |
[8K, 16K)              4 |                                                    |
[16K, 32K)          2270 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
[32K, 64K)            45 |@                                                   |
[64K, 128K)            3 |                                                    |
[128K, 256K)         141 |@@@                                                 |
[256K, 512K)          24 |                                                    |
[512K, 1M)             7 |                                                    |
[1M, 2M)               8 |                                                    |
[2M, 4M)              38 |                                                    |
[4M, 8M)             226 |@@@@@                                               |
[8M, 16M)            321 |@@@@@@@                                             |
[16M, 32M)           501 |@@@@@@@@@@@                                         |
[32M, 64M)            12 |                                                    |

# Without Patch

@: count 3600, average 12786599, total 46031757085

@c: 3608
@latency: 
[4K, 8K)               1 |                                                    |
[8K, 16K)              6 |                                                    |
[16K, 32K)           297 |@@@@@@@@@@@                                         |
[32K, 64K)            25 |                                                    |
[64K, 128K)            4 |                                                    |
[128K, 256K)         149 |@@@@@                                               |
[256K, 512K)          21 |                                                    |
[512K, 1M)             5 |                                                    |
[1M, 2M)              14 |                                                    |
[2M, 4M)              45 |@                                                   |
[4M, 8M)             857 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                   |
[8M, 16M)            812 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@                     |
[16M, 32M)          1325 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@|
[32M, 64M)            31 |@                                                   |

The patch leads to a significant decrease in latency of a newly woken task.

Tested-by: Mukesh Kumar Chaurasiya <mchauras@linux.ibm.com>
Reviewed-by: Mukesh Kumar Chaurasiya <mchauras@linux.ibm.com>

  reply	other threads:[~2024-07-01 16:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-27 13:33 [PATCH v2] sched: Initialize the vruntime of a new task when it is first enqueued Zhang Qiao
2024-07-01 15:55 ` Mukesh Kumar Chaurasiya [this message]
2024-07-16  5:32 ` Zhangqiao (2012 lab)
2024-07-16  9:15 ` Peter Zijlstra
2024-07-29 10:34 ` [tip: sched/core] " tip-bot2 for Zhang Qiao
2024-07-30  8:15   ` Mukesh Kumar Chaurasiya
2024-07-30  8:28     ` Peter Zijlstra
2024-07-30  9:42       ` Mukesh Kumar Chaurasiya

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=171984853311.154200.2041889183083175576.b4-ty@linux.ibm.com \
    --to=mchauras@linux.ibm.com \
    --cc=Markus.Elfring@web.de \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchauras@hotmail.com \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=zhangqiao22@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox