Re: [Intel-gfx] [RFC PATCH 157/162] drm/i915: Improve accuracy of eviction stats

2020-11-30 Thread Tvrtko Ursulin



On 27/11/2020 14:40, Chris Wilson wrote:

Quoting Matthew Auld (2020-11-27 12:07:13)

From: Tvrtko Ursulin 

Current code uses jiffie time to do the accounting and then does:

   diff = jiffies - start;
   msec = diff * 1000 / HZ;
   ...
   atomic_long_add(msec, >time_swap_out_ms);

If we assume jiffie can be as non-granular as 10ms and that the current
accounting records all evictions faster than one jiffie as infinite speed,
we can end up over-estimating the reported eviction throughput.

Fix this by accumulating ktime_t and only dividing to more user friendly
granularity at presentation time (debugfs read).

At the same time consolidate the code a bit and convert from multiple
atomics to single seqlock per stat.

Signed-off-by: Tvrtko Ursulin 
Cc: CQ Tang 
Cc: Sudeep Dutt 
Cc: Mika Kuoppala 


A lot of effort to fix up patches after the fact, might as well make it
a real PMU interface.


It did cross my mind and should be easy to add on top if deemed useful 
or interesting.


More importantly, it is okay with me to incorporate this patch into the 
earlier one(s) which first added statistics.


Regards,

Tvrtko
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [Intel-gfx] [RFC PATCH 157/162] drm/i915: Improve accuracy of eviction stats

2020-11-27 Thread Chris Wilson
Quoting Matthew Auld (2020-11-27 12:07:13)
> From: Tvrtko Ursulin 
> 
> Current code uses jiffie time to do the accounting and then does:
> 
>   diff = jiffies - start;
>   msec = diff * 1000 / HZ;
>   ...
>   atomic_long_add(msec, >time_swap_out_ms);
> 
> If we assume jiffie can be as non-granular as 10ms and that the current
> accounting records all evictions faster than one jiffie as infinite speed,
> we can end up over-estimating the reported eviction throughput.
> 
> Fix this by accumulating ktime_t and only dividing to more user friendly
> granularity at presentation time (debugfs read).
> 
> At the same time consolidate the code a bit and convert from multiple
> atomics to single seqlock per stat.
> 
> Signed-off-by: Tvrtko Ursulin 
> Cc: CQ Tang 
> Cc: Sudeep Dutt 
> Cc: Mika Kuoppala 

A lot of effort to fix up patches after the fact, might as well make it
a real PMU interface.
-Chris
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel