Linux performance degradation

I am trying to compare a product that runs on an Intel Pentium with Linux on top of it. The problem is that I get significant performance changes during successive test runs when using the RDTSC instruction. The execution time for the same software varies from 5 to 10 million clock cycles, so in the worst case, I have 100% overhead. I know there are performance variations caused by cache conflict, however, maybe I can fix other potential problems like interrupts, other processes, etc.?

It would be grateful for any useful tips on how to do this correctly.

Thanks a lot Kenny

+3
source share
5 answers

Common issues in this general area:

  • process migration in multiprocessor / multicore systems.
  • RDTSC is not compatible across all cores in multiprocessor / multicore systems.
  • other processes that take up processor time (also interrupts, I / O, screen activity, etc.)
  • CPU clock auto scaling
  • VM page errors, etc.

Solutions:

  • If you are using a single-threaded process on multiprocessor / multicore systems, use an affinity for the processor to block the process for a specific core. (Use the task set from the command line or call sched_setaffinity () from your code.)

  • , , , , . , . printf GUI - , , . ( , .)

  • , RDTSC ( clock_gettime (CLOCK_PROCESS_CPUTIME_ID,...) Linux).

  • (, Linux: cpufreq-set)

  • , N , ( VM ..). N - 1.

+3

: (man 1 nice), , , ( ), , ?

0

, , " ", 1 " ".

, ​​ "-s", "init 1".

, root. , , .

0

, , BIOS . , P4, , .

, , - .

, , , , .

You will also need to restart your computer and look at the BIOS settings to determine if it will do this automatically without knowing the operating system.

0
source

Have you considered running code inside valgrinds cachegrind or callgrind tools? They should be able to provide you with accurate command counts by running code through valgrinds "VM".

0
source

Source: https://habr.com/ru/post/1730029/


All Articles