Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 May 2006 07:48:45 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/opencrypto crypto.c
Message-ID:  <200605220748.k4M7mkU1016605@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
pjd         2006-05-22 07:48:45 UTC

  FreeBSD src repository

  Modified files:
    sys/opencrypto       crypto.c 
  Log:
  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
  blocked forever.
  
  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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200605220748.k4M7mkU1016605>