cvs commit: src/sys/opencrypto crypto.c
Pawel Jakub Dawidek
pjd at FreeBSD.org
Mon May 22 00:49:27 PDT 2006
pjd 2006-05-22 07:48:45 UTC
FreeBSD src repository
We must synchronize access to cc_qblocked, because there could be a race
where crypto_invoke() returns ERESTART and before we set cc_qblocked to 1,
crypto_unblock() is called and sets it to 0. This way we mark device as
Fix it by not setting cc_qblocked in the fast path and by protecting
crypto_invoke() in the crypto_proc thread with CRYPTO_Q_LOCK().
This won't slow things down, because there is no contention - we have
only one crypto thread. Actually it can be slightly faster, because we
save two atomic ops per crypto request.
The fast code path remains lock-less.
Revision Changes Path
1.21 +4 -17 src/sys/opencrypto/crypto.c
More information about the cvs-src