From: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
To: Namhyung Kim <namhyung@kernel.org>
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, Tim Chen <tim.c.chen@linux.intel.com>,
linux-perf-users <linux-perf-users@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
Madadi Vineeth Reddy <vineethr@linux.ibm.com>
Subject: Re: [PATCH v3] perf sched timehist: Add pre-migration wait time option
Date: Fri, 4 Oct 2024 12:28:11 +0530 [thread overview]
Message-ID: <28359234-e818-4e3c-a99d-5c2306c15f9a@linux.ibm.com> (raw)
In-Reply-To: <Zv8YiooRdcT-x8iN@google.com>
On 04/10/24 03:49, Namhyung Kim wrote:
> On Thu, Oct 03, 2024 at 03:04:28PM -0700, Tim Chen wrote:
>> On Wed, 2024-10-02 at 22:09 +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
>>
>> If a task migrate from CPU A to CPU B, but is unlucky that
>> someone took CPU B and it has to wait. Then it is yet again migrated to CPU C.
>> Do you only compute pre-mig time as
>> t_sched_migrate_task_CPU_A - t_sched_migrate_task_CPU_A?
>>
>> The task also spend some pre-mig time on CPU_B that probably
>> should be included. And that time is when it migrates to B
>> till it is migrated away from B. Do you take that into
>> account?
>
> Hmm.. right. The current code updates the migrate time only if it's 0.
> But I think it can just always update the time to get the latest one.
>
Right. I’ll update the code to always pick the latest migrate time, ensuring
that scenarios with multiple migrations in between are handled correctly.
Thanks,
Madadi Vineeth Reddy
> Thanks,
> Namhyung
next prev parent reply other threads:[~2024-10-04 6:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-02 16:39 [PATCH v3] perf sched timehist: Add pre-migration wait time option Madadi Vineeth Reddy
2024-10-03 0:35 ` Namhyung Kim
2024-10-03 3:07 ` Madadi Vineeth Reddy
2024-10-03 22:04 ` Tim Chen
2024-10-03 22:19 ` Namhyung Kim
2024-10-04 6:58 ` Madadi Vineeth Reddy [this message]
2024-10-04 6:55 ` Madadi Vineeth Reddy
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=28359234-e818-4e3c-a99d-5c2306c15f9a@linux.ibm.com \
--to=vineethr@linux.ibm.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=tim.c.chen@linux.intel.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