4 The cpuidle_haltpoll driver, with the haltpoll governor, allows
5 the guest vcpus to poll for a specified amount of time before
7 This provides the following benefits to host side polling:
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.
13 2) The VM-exit cost can be avoided.
15 The downside of guest side polling is that polling is performed
16 even with other runnable tasks in the host.
18 The basic logic as follows: A global value, guest_halt_poll_ns,
19 is configured by the user, indicating the maximum amount of
20 time polling is allowed. This value is fixed.
22 Each vcpu has an adjustable guest_halt_poll_ns
23 ("per-cpu guest_halt_poll_ns"), which is adjusted by the algorithm
24 in response to events (explained below).
29 The haltpoll governor has 5 tunable module parameters:
31 1) guest_halt_poll_ns:
32 Maximum amount of time, in nanoseconds, that polling is
33 performed before halting.
37 2) guest_halt_poll_shrink:
38 Division factor used to shrink per-cpu guest_halt_poll_ns when
39 wakeup event occurs after the global guest_halt_poll_ns.
43 3) guest_halt_poll_grow:
44 Multiplication factor used to grow per-cpu guest_halt_poll_ns
45 when event occurs after per-cpu guest_halt_poll_ns
46 but before global guest_halt_poll_ns.
50 4) guest_halt_poll_grow_start:
51 The per-cpu guest_halt_poll_ns eventually reaches zero
52 in case of an idle system. This value sets the initial
53 per-cpu guest_halt_poll_ns when growing. This can
54 be increased from 10000, to avoid misses during the initial
57 10k, 20k, 40k, ... (example assumes guest_halt_poll_grow=2).
61 5) guest_halt_poll_allow_shrink:
63 Bool parameter which allows shrinking. Set to N
64 to avoid it (per-cpu guest_halt_poll_ns will remain
65 high once achieves global guest_halt_poll_ns value).
69 The module parameters can be set from the debugfs files in:
71 /sys/module/haltpoll/parameters/
76 - Care should be taken when setting the guest_halt_poll_ns parameter as a
77 large value has the potential to drive the cpu usage to 100% on a machine which
78 would be almost entirely idle otherwise.