Use Linux perf stat after writing a jmh bench and inspect the assembly to
make sure what's goin on

Il sab 14 feb 2026, 10:39 r r <[email protected]> ha scritto:

> Thread  *T *is alway running - it has loops in manner:
>
> while(!isInterrupted()) {
>   checkForWork();
>   noIdle
>  }
> or
> while(!isInterrupted()) {
>   checkForWork();
>   Thread.onSpinWait() // PAUSE on X86
> }
>
> In both cases I see this difference.
>
> C-state should not be the case because of kernel option ilde=poll.
>
> sobota, 14 lutego 2026 o 08:51:21 UTC+1 [email protected] napisał(a):
>
>> Hi,
>>
>> It can be due to cpu C state. When the CPU is isolated, there is no task
>> assigned to it when the pinned thread is not running thus increases the
>> chance for it to go to deep sleep state, it is quite costly to wake up from
>> deep sleep state. For non isolated cores, they are probably consistently
>> running tasks thus lower chance to go to deep sleep state.
>>
>> You can try to disable c state in bios and see if it helps.
>>
>> Best Regards,
>> GS
>>
>>
>> On Saturday, February 14, 2026 at 4:26:04 AM UTC+8 [email protected]
>> wrote:
>>
>> No. Actually, after some retests my observation is that it happens
>> regardless the thread is pinned or not.
>> So,
>>
>> When thread *T* is pinned to CPU #10 and the task interval is set to
>> 1ms, the average task execution time is *100 µs*. However, when the task
>> interval is increased to 40ms on the same pinned core, the average
>> execution time significantly degrades to *250 µs*. If T is not pinned,
>> the result is same.
>>
>>
>> piątek, 13 lutego 2026 o 18:39:03 UTC+1 Mark E. Dawson, Jr. napisał(a):
>>
>> Do you have a baseline for how your isolated core should perform using a
>> tool like 'osnoise'?
>>
>> On Friday, February 13, 2026 at 10:18:49 AM UTC-6 [email protected]
>> wrote:
>>
>> Hi,
>>
>> let's look at the example:
>>
>> The system is running with the following kernel parameters:
>>
>> isolcpus=10, nohz_full=10, nohz=on, idle=poll, intel_pstate=disable.
>>
>> We have a thread *T* that uses Thread.onSpinWait() while polling a
>> lock-free shared queue. In this context, the *task interval* refers to
>> the time elapsed between adding consecutive tasks to the queue.
>>
>> When thread *T* is pinned to CPU #10 and the task interval is set to
>> 1ms, the average task execution time is *100 µs*. However, when the task
>> interval is increased to 40ms on the same pinned core, the average
>> execution time significantly degrades to *250 µs*.
>>
>> In contrast, when thread *T* is unpinned, the performance remains much
>> more consistent. At a 1ms task interval, the average execution time is *110
>> µs*, and it only slightly increases to *120 µs* when the interval is
>> extended to 40ms.
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "mechanical-sympathy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion, visit
> https://groups.google.com/d/msgid/mechanical-sympathy/9c15417b-8c8c-4b76-b63e-1f9d38d507e0n%40googlegroups.com
> <https://groups.google.com/d/msgid/mechanical-sympathy/9c15417b-8c8c-4b76-b63e-1f9d38d507e0n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion, visit 
https://groups.google.com/d/msgid/mechanical-sympathy/CAJTku1n8SEM1XamnMgz2PK2%3DM9f4fHS-ciBO5D%2B0LjfnGx%3D2Bw%40mail.gmail.com.

Reply via email to