Setting the polling thread

7.1 LPAR mode z/VM guest KVM guest

Enabling the polling thread can improve cryptographic performance.

Before you begin

You cannot activate the polling thread in environments that support AP adapter interrupts, see AP adapter interrupts.

About this task

As of System z10®, 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 zcrypt device driver can run with or without the polling thread. When zcrypt 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