Re: Question around the time precision

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

 



On Tue, 27 Oct 2020 at 06:56, Erwan Velu <e.velu@xxxxxxxxxx> wrote:
>
> Hello list,
>
> I found pretty handy being able to simulate and control the cpu activity
> by using the cpuio engine.
>
> The actual code is doing a simple nop loop for the expected duration.
>
>
> I'm thinking about adding other loops like having sse or avx loops to
> stress the CPU differently.
>
> I was wondering how accurate must be the loop. Is there any particular
> expectation or constrains to know ?

>From looking at
https://fio.readthedocs.io/en/latest/fio_doc.html#cmdoption-arg-cpuload
it seems the load can only be specified in an integer percentage.
Looking at https://github.com/axboe/fio/blob/7eff05d723d1330a5407b2bdd9145f1bfb6dd0e1/time.c#L29
(which is used to do the waiting) it looks like it is only accurate to
microseconds. It seems like
https://fio.readthedocs.io/en/latest/fio_doc.html#cmdoption-arg-cpuchunks
is the period and that period is divided into sleeping without using
CPU and the rest of the time busy looping. By default it's 50000 usec
so if people aren't changing that it would suggest you can't have a
single loop of your burn take longer than 500 usec...

Maybe if a single loop of your burn has some minimum time greater than
a microsecond (I don't think it makes sense to set cpuchunks to less
than 100) you can check the values in the engine at init time and spit
out a warning/error?

-- 
Sitsofe | http://sucs.org/~sits/



[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux