kernel - opencrypto - optimize chained synchronous callbacks for soft crypto
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 20 Aug 2010 20:05:54 +0000 (13:05 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 20 Aug 2010 20:05:54 +0000 (13:05 -0700)
commit345ee1fbc233997066e5042695d9c4a5a299803c
tree93e8ebd6a4687b10854d4e2088da7d59f2487c1a
parentee147bcb549a4f16b1abd8643f7b19fc28be6fbb
kernel - opencrypto - optimize chained synchronous callbacks for soft crypto

* When a crypto operation is dispatched to a crypto thread and makes a
  synchronous callback from that thread, and the callback function
  dispatches a followup crypto as part of a chain, we ignore F_BATCH
  and run the followup crypto directly.

  Since we are already in a crypto thread there's no point dispatching
  the followup crypto to another crypto thread.

  Increases dm_crypt's essiv performance w/software crypto by 7%.

* Warning: The chain length for crypto operations with synchronous
  callbacks should be limited to 2 or 3 to avoid blowing up the kernel's
  thread stack.
sys/opencrypto/crypto.c
sys/sys/thread.h