Re: [PATCH v4 1/2] x86/fpu: track AVX-512 usage of tasks

From: Dave Hansen
Date: Tue Dec 11 2018 - 20:06:55 EST

On 12/11/18 4:59 PM, Li, Aubrey wrote:
>> maybe instead of a 1/0 bit, it's useful to store the timestamp of the last
>> time we found the task to use avx? (need to find a good time unit)
> Are you suggesting kernel does not do any translation, just provide a fact
> to the user space tool and let user space tool to decide how to use this info?
> So how does user space tool use this timestamp in your mind?

Couple of things...

If we have a timestamp, we don't need a decay. That means less tuning
and also less work at runtime in the common case.

Let's say we report milliseconds. The app itself looks at the number
and could now say the following:

1. task A used AVX512 1ms ago, I might need to segregate it
2. task B used AVX512 10000ms ago, time to stop segregating it
3. task C used AVX512 1ms ago, and was using it 100ms ago (during the
last scan), it's a regular AVX512 user.

That way, you don't have to *catch* tasks in the window between use and
the end of the decay period.