[PATCH 1/5] drm/i915/gvt: add some statistic routine for scheduler

Du, Changbin changbin.du at intel.com
Mon Feb 6 06:30:05 UTC 2017


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.

> -- 
> 2.7.4
> 
> _______________________________________________
> 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/20170206/9983b2db/attachment.sig>


More information about the intel-gvt-dev mailing list