[PATCH 1/5] drm/i915/gvt: add some statistic routine for scheduler
Du, Changbin
changbin.du at intel.com
Tue Feb 7 02:41:46 UTC 2017
On Tue, Feb 07, 2017 at 08:53:01AM +0800, Gao, Ping A wrote:
>
> On 2017/2/6 14:30, Du, Changbin wrote:
> > On Thu, Jan 26, 2017 at 09:19:14AM +0800, Ping Gao wrote:
> >> Add some statistic routine to collect the time when vGPU
> >> schedule in/out.
> >>
> >> Signed-off-by: Ping Gao <ping.a.gao at intel.com>
> >> ---
> >>
> >> @@ -77,6 +99,14 @@ static void try_to_schedule_next_vgpu(struct intel_gvt *gvt)
> >> gvt_dbg_sched("switch to next vgpu %d\n",
> >> scheduler->next_vgpu->id);
> >>
> >> + cur_cycles = get_cycles();
> >> + if (scheduler->current_vgpu) {
> >> + vgpu_data = scheduler->current_vgpu->sched_data;
> >> + vgpu_data->sched_out_time = cur_cycles;
> >> + }
> >> + vgpu_data = scheduler->next_vgpu->sched_data;
> >> + vgpu_data->sched_in_time = cur_cycles;
> >> +
> >> /* switch current vgpu */
> >> scheduler->current_vgpu = scheduler->next_vgpu;
> >> scheduler->next_vgpu = NULL;
> > Hi, Ping. I am thinking whether jiffies has good resolution here,
> > because the schedule period is as long as 100ms.
> > As you know the TSC has many issues today, considring its behaviour
> > varies from different CPUs. It turns out TSC is hard to use to
> > measure time. Though recent intel CPU has a constant TSC, but to
> > keep code compatibility a more common time source should be prefered.
>
> Hi Changbin, The default schedule period should set to 1ms, as most ctx
> finished in 2ms;
> jiffies is not suitable for this purpose:
> 1. jiffies is not precise enough, as ctx executing time is varied from
> hundred nanosecond to several microsecond.
> 2. it depend on the HZ of the system setting, vGPU scheduler behavior
> should not rely on any config setting.
>
oh, jiffies only has microsecond resolution. Hence seems only tsc can
meet this requirment. I think you can add a inline function like
tsc2ns(). :)
> >> --
> >> 2.7.4
> >>
> >> _______________________________________________
> >> intel-gvt-dev mailing list
> >> intel-gvt-dev at lists.freedesktop.org
> >> https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev
>
> _______________________________________________
> intel-gvt-dev mailing list
> intel-gvt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev
--
Best Regards,
Open Source Technology Center, Intel Corp.
Du, Changbin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gvt-dev/attachments/20170207/f1f8fbdf/attachment.sig>
More information about the intel-gvt-dev
mailing list