[PATCH] drm/i915/gvt: avoid unnecessary vgpu switch

Zhenyu Wang zhenyuw at linux.intel.com
Tue Apr 18 05:14:20 UTC 2017


On 2017.04.17 13:43:53 +0800, Ping Gao wrote:
> It's no need to switch vgpu if next vgpu is the same with current
> vgpu, otherwise it will make performance drop in some case.
> 
> Signed-off-by: Ping Gao <ping.a.gao at intel.com>
> ---
>  drivers/gpu/drm/i915/gvt/sched_policy.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/gvt/sched_policy.c b/drivers/gpu/drm/i915/gvt/sched_policy.c
> index 79ba4b3..450a7ca 100644
> --- a/drivers/gpu/drm/i915/gvt/sched_policy.c
> +++ b/drivers/gpu/drm/i915/gvt/sched_policy.c
> @@ -130,8 +130,10 @@ static void try_to_schedule_next_vgpu(struct intel_gvt *gvt)
>  	ktime_t cur_time;
>  
>  	/* no target to schedule */
> -	if (!scheduler->next_vgpu)
> +	if (scheduler->next_vgpu == scheduler->current_vgpu) {
> +		scheduler->next_vgpu = NULL;
>  		return;
> +	}
>

ok, might clarify that upper caller will check next_vgpu NULL case
so that can be removed inside this.

>  	/*
>  	 * after the flag is set, workload dispatch thread will
> -- 
> 1.9.1
> 
> _______________________________________________
> intel-gvt-dev mailing list
> intel-gvt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gvt-dev/attachments/20170418/74025e73/attachment.sig>


More information about the intel-gvt-dev mailing list