Setting the polling thread

Ubuntu 22.04 LTS z/VM guest KVM guest

For Linux® on z/VM®, enabling the polling thread can improve cryptographic performance.

About this task

Linux in LPAR mode supports AP interrupts that indicate the completion of cryptographic requests. If AP interrupts are available, it is not possible to activate the polling thread.

The cryptographic device driver can run with or without the polling thread. When it runs with the polling thread, one processor constantly polls the cryptographic cards for finished cryptographic requests while requests are being processed. The polling thread sleeps when no cryptographic requests are being processed. This mode uses the cryptographic cards as much as possible, at the cost of blocking one processor during cryptographic operations.

Without the polling thread, the cryptographic cards are polled at a much lower rate. The lower rate results in higher latency and reduced throughput for cryptographic requests, but without a noticeable processor load.

Procedure

  • Use the chzcrypt command to set the polling thread.
    Examples:
    • To activate the polling thread issue:
      # chzcrypt -p
    • To deactivate the polling thread issue:
      # chzcrypt -n
  • Alternatively, you can set the polling thread through the poll_thread sysfs attribute.
    This read-write attribute can be found at the AP bus level.
    Examples:
    • To activate the polling thread issue:
      # echo 1 > /sys/bus/ap/poll_thread
    • To deactivate the polling thread issue:
      # echo 0 > /sys/bus/ap/poll_thread