Setting the polling thread

Red Hat Enterprise Linux 9.2 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 interrupts that indicate the completion of cryptographic requests. If AP interrupts are available, it is not possible to activate the polling thread.

Depending on the workload, enabling the polling thread can increase cryptographic performance. For Linux on z/VM, the polling thread is deactivated by default.

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 a polling thread for a device 0x3e issue:
      echo 1 > /sys/bus/ap/devices/card3e/poll_thread
    • To deactivate a polling thread for a cryptographic device with bus device-ID 0x3e issue:
      echo 0 > /sys/bus/ap/devices/card3e/poll_thread