guest-halt-polling.rst 2.3 KB

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