85 lines · plain
1==================2Guest halt polling3==================4 5The cpuidle_haltpoll driver, with the haltpoll governor, allows6the guest vcpus to poll for a specified amount of time before7halting.8 9This provides the following benefits to host side polling:10 11 1) The POLL flag is set while polling is performed, which allows12 a remote vCPU to avoid sending an IPI (and the associated13 cost of handling the IPI) when performing a wakeup.14 15 2) The VM-exit cost can be avoided.16 17The downside of guest side polling is that polling is performed18even with other runnable tasks in the host.19 20The basic logic as follows: A global value, guest_halt_poll_ns,21is configured by the user, indicating the maximum amount of22time polling is allowed. This value is fixed.23 24Each vcpu has an adjustable guest_halt_poll_ns25("per-cpu guest_halt_poll_ns"), which is adjusted by the algorithm26in response to events (explained below).27 28Module Parameters29=================30 31The haltpoll governor has 5 tunable module parameters:32 331) guest_halt_poll_ns:34 35Maximum amount of time, in nanoseconds, that polling is36performed before halting.37 38Default: 20000039 402) guest_halt_poll_shrink:41 42Division factor used to shrink per-cpu guest_halt_poll_ns when43wakeup event occurs after the global guest_halt_poll_ns.44 45Default: 246 473) guest_halt_poll_grow:48 49Multiplication factor used to grow per-cpu guest_halt_poll_ns50when event occurs after per-cpu guest_halt_poll_ns51but before global guest_halt_poll_ns.52 53Default: 254 554) guest_halt_poll_grow_start:56 57The per-cpu guest_halt_poll_ns eventually reaches zero58in case of an idle system. This value sets the initial59per-cpu guest_halt_poll_ns when growing. This can60be increased from 10000, to avoid misses during the initial61growth stage:62 6310k, 20k, 40k, ... (example assumes guest_halt_poll_grow=2).64 65Default: 5000066 675) guest_halt_poll_allow_shrink:68 69Bool parameter which allows shrinking. Set to N70to avoid it (per-cpu guest_halt_poll_ns will remain71high once achieves global guest_halt_poll_ns value).72 73Default: Y74 75The module parameters can be set from the sysfs files in::76 77 /sys/module/haltpoll/parameters/78 79Further Notes80=============81 82- Care should be taken when setting the guest_halt_poll_ns parameter as a83 large value has the potential to drive the cpu usage to 100% on a machine84 which would be almost entirely idle otherwise.85