From: Tim Chen <tim.c.chen@linux.intel.com>
To: Namhyung Kim <namhyung@kernel.org>,
Madadi Vineeth Reddy <vineethr@linux.ibm.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
Ian Rogers <irogers@google.com>,
Athira Rajeev <atrajeev@linux.vnet.ibm.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>,
Kan Liang <kan.liang@linux.intel.com>,
acme@redhat.com,
linux-perf-users <linux-perf-users@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v6] perf sched timehist: Add pre-migration wait time option
Date: Fri, 11 Oct 2024 10:44:35 -0700 [thread overview]
Message-ID: <0069d2dd01235b8e301837b041c4db58b296fbab.camel@linux.intel.com> (raw)
In-Reply-To: <Zwf_ep16969kIE2y@google.com>
On Thu, 2024-10-10 at 09:23 -0700, Namhyung Kim wrote:
> Hello Tim,
>
> On Fri, Oct 04, 2024 at 10:37:56PM +0530, Madadi Vineeth Reddy wrote:
> > pre-migration wait time is the time that a task unnecessarily spends
> > on the runqueue of a CPU but doesn't get switched-in there. In terms
> > of tracepoints, it is the time between sched:sched_wakeup and
> > sched:sched_migrate_task.
> >
> > Let's say a task woke up on CPU2, then it got migrated to CPU4 and
> > then it's switched-in to CPU4. So, here pre-migration wait time is
> > time that it was waiting on runqueue of CPU2 after it is woken up.
> >
> > The general pattern for pre-migration to occur is:
> > sched:sched_wakeup
> > sched:sched_migrate_task
> > sched:sched_switch
> >
> > The sched:sched_waking event is used to capture the wakeup time,
> > as it aligns with the existing code and only introduces a negligible
> > time difference.
> >
> > pre-migrations are generally not useful and it increases migrations.
> > This metric would be helpful in testing patches mainly related to wakeup
> > and load-balancer code paths as better wakeup logic would choose an
> > optimal CPU where task would be switched-in and thereby reducing pre-
> > migrations.
> >
> > The sample output(s) when -P or --pre-migrations is used:
> > =================
> > time cpu task name wait time sch delay run time pre-mig time
> > [tid/pid] (msec) (msec) (msec) (msec)
> > --------------- ------ ------------------------------ --------- --------- --------- ---------
> > 38456.720806 [0001] schbench[28634/28574] 4.917 4.768 1.004 0.000
> > 38456.720810 [0001] rcu_preempt[18] 3.919 0.003 0.004 0.000
> > 38456.721800 [0006] schbench[28779/28574] 23.465 23.465 1.999 0.000
> > 38456.722800 [0002] schbench[28773/28574] 60.371 60.237 3.955 60.197
> > 38456.722806 [0001] schbench[28634/28574] 0.004 0.004 1.996 0.000
> > 38456.722811 [0001] rcu_preempt[18] 1.996 0.005 0.005 0.000
> > 38456.723800 [0000] schbench[28833/28574] 4.000 4.000 3.999 0.000
> > 38456.723800 [0004] schbench[28762/28574] 42.951 42.839 3.999 39.867
> > 38456.723802 [0007] schbench[28812/28574] 43.947 43.817 3.999 40.866
> > 38456.723804 [0001] schbench[28587/28574] 7.935 7.822 0.993 0.000
> >
> > Signed-off-by: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
> >
> > ---
> > Changes in v6:
> > - Handle the case of multiple migrations before the task is
> > scheduled in. (Tim Chen)
>
> Are you ok with this now?
Yes, you can add my reviewed-by.
>
> Thanks,
> Namhyung
>
>
next prev parent reply other threads:[~2024-10-11 17:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-04 17:07 [PATCH v6] perf sched timehist: Add pre-migration wait time option Madadi Vineeth Reddy
2024-10-10 16:23 ` Namhyung Kim
2024-10-11 17:44 ` Tim Chen [this message]
2024-10-16 17:12 ` Namhyung Kim
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=0069d2dd01235b8e301837b041c4db58b296fbab.camel@linux.intel.com \
--to=tim.c.chen@linux.intel.com \
--cc=acme@kernel.org \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=atrajeev@linux.vnet.ibm.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=vineethr@linux.ibm.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;
as well as URLs for NNTP newsgroup(s).