DragonFly-2.3.0.864.gc5b83 master sys/platform/pc32/apic mpapic.c sys/platform/pc32/isa clock.c sys/platform/pc64/isa clock.c sys/platform/vkernel/platform systimer.c sys/sys systimer.h

Sepherosa Ziehau sepherosa at gmail.com
Mon May 4 19:01:32 PDT 2009


On Tue, May 5, 2009 at 2:12 AM, Hasso Tepper <hasso at estpak.ee> wrote:
> Sepherosa Ziehau wrote:
>> Could you give me the estimate about how long the C3 state will
>> maintain, if lapic timer is not used?
>
> Is this data helpful for you?

I am thinking about when to reprogram i8254 if lapic timer is used,
and when to enter C3.  Since we could always snoop systimer left time,
we could do kinda "throttle".  e.g. If time left is < 4ms, we don't
enter C3 but C2 instead, and i8254 is not programmed at all.  4ms is
chosen because the 3 main clock freq is 100hz, 128hz, and 50hz, the
gross estimation is: within 40ms one shot timer will be reloaded with
following sequence theoreticly (unit ms, 128hz -> 125hz to ease the
calculation):
8 2 6 4 4 6 2 8
So, if 4 is picked, we could have 80% chance to enter C3, even if 5 is
picked, we still have 50% chance to enter C3, but the i8254 interrupt
rate could be throttled back at no more than 250-200hz on CPU0.  We
obviously could make the threshold value tunable.  However, the worry
is that userspace nanosleep with short interval (like 1ms) could
prevent C3 state from being entered.

>
> $ for i in `seq 1 20`; do sysctl -a | grep cx_usage; sleep 1; done
> hw.cpu0.cx_usage: 0.00% 3.13% 96.86% last 98us
> hw.cpu1.cx_usage: 0.00% 2.00% 97.99% last 165us
> hw.cpu0.cx_usage: 0.00% 3.15% 96.84% last 30us
> hw.cpu1.cx_usage: 0.00% 2.02% 97.97% last 94us
> hw.cpu0.cx_usage: 0.00% 3.18% 96.81% last 35us
> hw.cpu1.cx_usage: 0.00% 2.04% 97.95% last 112us
> hw.cpu0.cx_usage: 0.00% 3.24% 96.75% last 22us
> hw.cpu1.cx_usage: 0.00% 2.05% 97.94% last 25us
> hw.cpu0.cx_usage: 0.00% 3.27% 96.72% last 99us
> hw.cpu1.cx_usage: 0.00% 2.07% 97.92% last 96us
> hw.cpu0.cx_usage: 0.00% 3.29% 96.70% last 1529us
> hw.cpu1.cx_usage: 0.00% 2.09% 97.90% last 168us
> hw.cpu0.cx_usage: 0.00% 3.36% 96.63% last 276us
> hw.cpu1.cx_usage: 0.00% 2.09% 97.90% last 174us
> hw.cpu0.cx_usage: 0.00% 3.36% 96.63% last 25us
> hw.cpu1.cx_usage: 0.00% 2.13% 97.86% last 176us
> hw.cpu0.cx_usage: 0.00% 3.38% 96.61% last 24us
> hw.cpu1.cx_usage: 0.00% 2.16% 97.83% last 23us
> hw.cpu0.cx_usage: 0.00% 3.41% 96.58% last 72us
> hw.cpu1.cx_usage: 0.00% 2.18% 97.81% last 118us
> hw.cpu0.cx_usage: 0.00% 3.46% 96.53% last 23us
> hw.cpu1.cx_usage: 0.00% 2.19% 97.80% last 187us
> hw.cpu0.cx_usage: 0.00% 3.51% 96.48% last 333us
> hw.cpu1.cx_usage: 0.00% 2.20% 97.79% last 111us
> hw.cpu0.cx_usage: 0.00% 3.57% 96.42% last 3040us
> hw.cpu1.cx_usage: 0.00% 2.21% 97.78% last 181us
> hw.cpu0.cx_usage: 0.00% 3.60% 96.39% last 28us
> hw.cpu1.cx_usage: 0.00% 2.22% 97.77% last 103us
> hw.cpu0.cx_usage: 0.00% 3.64% 96.35% last 24us
> hw.cpu1.cx_usage: 0.00% 2.24% 97.75% last 597us
> hw.cpu0.cx_usage: 0.00% 3.68% 96.31% last 44us
> hw.cpu1.cx_usage: 0.00% 2.26% 97.73% last 59us
> hw.cpu0.cx_usage: 0.00% 3.72% 96.27% last 883us
> hw.cpu1.cx_usage: 0.00% 2.27% 97.72% last 77us
> hw.cpu0.cx_usage: 0.00% 3.77% 96.22% last 29us
> hw.cpu1.cx_usage: 0.00% 2.28% 97.71% last 111us
> hw.cpu0.cx_usage: 0.00% 3.82% 96.17% last 19us
> hw.cpu1.cx_usage: 0.00% 2.29% 97.70% last 227us
> hw.cpu0.cx_usage: 0.00% 3.87% 96.12% last 23us
> hw.cpu1.cx_usage: 0.00% 2.30% 97.69% last 138us
> $
>
>
> --
> Hasso Tepper
>



-- 
Live Free or Die





More information about the Commits mailing list