Is Tickless Linux kernel a phenomenon of time variation?

I am running some tests, and I am wondering if using Linux without a mark (aka CONFIG_NO_HZ_FULL_ALL ) Linux will be useful or harmful for benchmarking.

The tests that I run will be repeated many times, using the new process every time. I want to control as many sources of change as possible.

I read on the internet:

From these sources, I learned that:

  • In the default configuration ( CONFIG_NO_HZ=y ), only inactive processors receive ticks. Therefore, in this mode, my tests will always receive ticks.

  • In the "no mark" mode ( CONFIG_NO_HZ_FULL_ALL ), all processors, except one (boot processor), are in the "adaptive tick" mode. When the CPU is in adaptive tick mode, ticks are only accepted if there are more than one task in the schedule queue for the CPU. The idea is that if there is a single process in the queue, the context switch cannot happen, so sending ticks is not required.

On the one hand, the lack of benchmarks receiving ticks seems like a great idea, since we exclude the tick procedure as a source of variation (we do not know how long the tick procedures have been running). On the other hand, I believe that non-coding mode can make changes to control timings.

Consider my benchmarking scenario that runs on a non-core kernel. Suppose we repeat the benchmark twice.

  • Suppose that the first launch is lucky and it is planned for an adaptive tick processor that was previously inactive. Therefore, this test will not be interrupted by ticks.

  • When the test is run a second time, perhaps it’s not so lucky, and it gets to the processor on which some processes are already planned. This run will be interrupted with ticks at regular intervals to decide whether we need to move on to one of the other processes.

We know that ticks inflict a performance hit (context switch plus the time it takes to execute a subroutine). Therefore, the first control run had an unfair advantage and seemed to work faster.

Please also note that in a test that initially has an adaptive tick processor for itself, it may turn out that in the middle of the test another process goes to the same processor. In this case, the benchmark does not initially receive ticks, and then begins to receive them. This means that test performance may vary over time.

Thus, I believe that the non-mode (in my benchmarking scenario) represents temporary variations. Are my reasoning correct?

One solution would be to use an isolated CPU with an adaptive tick for benchmarking ( isolcpus + taskset ), however, we already excluded isolated processors, as this leads to artificial slowdowns in our multi-threaded tests.

thanks

+7
performance benchmarking linux kernel scheduling
source share
1 answer

For your "unsuccessful" scenario, an active task on one processor should be scheduled above. This is unlikely to occur otherwise if the system is inactive, assuming you have multiple processors. Even if this happens once or twice, it means that your test can see the effect of one or two ticks - which hardly seems problematic.

On the other hand, if this happens in many more cases, it will be a common indicator of high CPU utilization - not an ideal scenario for running tests anyway.

I would suggest that ticks are unlikely to be a significant source of changes in your control timings. The scheduler must be O (1). I doubt that you will see a big difference in variation between painless and without a tick mode.

+5
source share

All Articles