Re: [PATCH v2] drm/i915: Assert that the context pin_counts do not overflow

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On to, 2017-03-16 at 17:16 +0000, Chris Wilson wrote:
> This should be impossible, but let's assert that we do not pin a context
> 4 billion times before retiring!
> 
> v2: Fix the assertion -- the patch had just one job to do!
> 
> Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxxxxxxxx>
> Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
> Cc: Mika Kuoppala <mika.kuoppala@xxxxxxxxx>

<SNIP>

> @@ -748,6 +748,7 @@ static int execlists_context_pin(struct intel_engine_cs *engine,
>  
>  	if (ce->pin_count++)
>  		return 0;
> +	GEM_BUG_ON(!ce->pin_count); /* no overflow please! */

An average engineer is able to tell this is about overflow, even
without the comment :P

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux