Back to home page

OSCL-LXR

 
 

    


0001 ==================
0002 Guest halt polling
0003 ==================
0004 
0005 The cpuidle_haltpoll driver, with the haltpoll governor, allows
0006 the guest vcpus to poll for a specified amount of time before
0007 halting.
0008 
0009 This provides the following benefits to host side polling:
0010 
0011         1) The POLL flag is set while polling is performed, which allows
0012            a remote vCPU to avoid sending an IPI (and the associated
0013            cost of handling the IPI) when performing a wakeup.
0014 
0015         2) The VM-exit cost can be avoided.
0016 
0017 The downside of guest side polling is that polling is performed
0018 even with other runnable tasks in the host.
0019 
0020 The basic logic as follows: A global value, guest_halt_poll_ns,
0021 is configured by the user, indicating the maximum amount of
0022 time polling is allowed. This value is fixed.
0023 
0024 Each vcpu has an adjustable guest_halt_poll_ns
0025 ("per-cpu guest_halt_poll_ns"), which is adjusted by the algorithm
0026 in response to events (explained below).
0027 
0028 Module Parameters
0029 =================
0030 
0031 The haltpoll governor has 5 tunable module parameters:
0032 
0033 1) guest_halt_poll_ns:
0034 
0035 Maximum amount of time, in nanoseconds, that polling is
0036 performed before halting.
0037 
0038 Default: 200000
0039 
0040 2) guest_halt_poll_shrink:
0041 
0042 Division factor used to shrink per-cpu guest_halt_poll_ns when
0043 wakeup event occurs after the global guest_halt_poll_ns.
0044 
0045 Default: 2
0046 
0047 3) guest_halt_poll_grow:
0048 
0049 Multiplication factor used to grow per-cpu guest_halt_poll_ns
0050 when event occurs after per-cpu guest_halt_poll_ns
0051 but before global guest_halt_poll_ns.
0052 
0053 Default: 2
0054 
0055 4) guest_halt_poll_grow_start:
0056 
0057 The per-cpu guest_halt_poll_ns eventually reaches zero
0058 in case of an idle system. This value sets the initial
0059 per-cpu guest_halt_poll_ns when growing. This can
0060 be increased from 10000, to avoid misses during the initial
0061 growth stage:
0062 
0063 10k, 20k, 40k, ... (example assumes guest_halt_poll_grow=2).
0064 
0065 Default: 50000
0066 
0067 5) guest_halt_poll_allow_shrink:
0068 
0069 Bool parameter which allows shrinking. Set to N
0070 to avoid it (per-cpu guest_halt_poll_ns will remain
0071 high once achieves global guest_halt_poll_ns value).
0072 
0073 Default: Y
0074 
0075 The module parameters can be set from the debugfs files in::
0076 
0077         /sys/module/haltpoll/parameters/
0078 
0079 Further Notes
0080 =============
0081 
0082 - Care should be taken when setting the guest_halt_poll_ns parameter as a
0083   large value has the potential to drive the cpu usage to 100% on a machine
0084   which would be almost entirely idle otherwise.