From owner-cvs-all@FreeBSD.ORG Mon May 22 10:06:06 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1103B16A4AB; Mon, 22 May 2006 10:06:06 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D60B043D46; Mon, 22 May 2006 10:06:05 +0000 (GMT) (envelope-from pjd@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id k4MA5Okv035801; Mon, 22 May 2006 10:05:24 GMT (envelope-from pjd@repoman.freebsd.org) Received: (from pjd@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id k4MA5Oux035800; Mon, 22 May 2006 10:05:24 GMT (envelope-from pjd) Message-Id: <200605221005.k4MA5Oux035800@repoman.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 22 May 2006 10:05:24 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/opencrypto crypto.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 May 2006 10:06:06 -0000 pjd 2006-05-22 10:05:24 UTC FreeBSD src repository Modified files: sys/opencrypto crypto.c Log: Improve the code responsible for waking up the crypto_proc thread. Checking if the queues are empty is not enough for the crypto_proc thread (it is enough for the crypto_ret_thread), because drivers can be marked as blocked. In a situation where we have operations related to different crypto drivers in the queue, it is possible that one driver is marked as blocked. In this case, the queue will not be empty and we won't wakeup the crypto_proc thread to execute operations for the others drivers. Simply setting a global variable to 1 when we goes to sleep and setting it back to 0 when we wake up is sufficient. The variable is protected with the queue lock. Revision Changes Path 1.24 +11 -14 src/sys/opencrypto/crypto.c