[PATCH 1/5] drm/i915/gvt: add some statistic routine for scheduler
Gao, Ping A
ping.a.gao at intel.com
Tue Feb 7 00:53:01 UTC 2017
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.
>> --
>> 2.7.4
>>
>> _______________________________________________
>> intel-gvt-dev mailing list
>> intel-gvt-dev at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev
More information about the intel-gvt-dev
mailing list