1Guest halt polling 2================== 3 4The cpuidle_haltpoll driver, with the haltpoll governor, allows 5the guest vcpus to poll for a specified amount of time before 6halting. 7This provides the following benefits to host side polling: 8 9 1) The POLL flag is set while polling is performed, which allows 10 a remote vCPU to avoid sending an IPI (and the associated 11 cost of handling the IPI) when performing a wakeup. 12 13 2) The VM-exit cost can be avoided. 14 15The downside of guest side polling is that polling is performed 16even with other runnable tasks in the host. 17 18The basic logic as follows: A global value, guest_halt_poll_ns, 19is configured by the user, indicating the maximum amount of 20time polling is allowed. This value is fixed. 21 22Each vcpu has an adjustable guest_halt_poll_ns 23("per-cpu guest_halt_poll_ns"), which is adjusted by the algorithm 24in response to events (explained below). 25 26Module Parameters 27================= 28 29The haltpoll governor has 5 tunable module parameters: 30 311) guest_halt_poll_ns: 32Maximum amount of time, in nanoseconds, that polling is 33performed before halting. 34 35Default: 200000 36 372) guest_halt_poll_shrink: 38Division factor used to shrink per-cpu guest_halt_poll_ns when 39wakeup event occurs after the global guest_halt_poll_ns. 40 41Default: 2 42 433) guest_halt_poll_grow: 44Multiplication factor used to grow per-cpu guest_halt_poll_ns 45when event occurs after per-cpu guest_halt_poll_ns 46but before global guest_halt_poll_ns. 47 48Default: 2 49 504) guest_halt_poll_grow_start: 51The per-cpu guest_halt_poll_ns eventually reaches zero 52in case of an idle system. This value sets the initial 53per-cpu guest_halt_poll_ns when growing. This can 54be increased from 10000, to avoid misses during the initial 55growth stage: 56 5710k, 20k, 40k, ... (example assumes guest_halt_poll_grow=2). 58 59Default: 50000 60 615) guest_halt_poll_allow_shrink: 62 63Bool parameter which allows shrinking. Set to N 64to avoid it (per-cpu guest_halt_poll_ns will remain 65high once achieves global guest_halt_poll_ns value). 66 67Default: Y 68 69The module parameters can be set from the debugfs files in: 70 71 /sys/module/haltpoll/parameters/ 72 73Further Notes 74============= 75 76- Care should be taken when setting the guest_halt_poll_ns parameter as a 77large value has the potential to drive the cpu usage to 100% on a machine which 78would be almost entirely idle otherwise. 79