From owner-cvs-all@FreeBSD.ORG Mon Nov 29 00:39:03 2004 Return-Path: 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 0F7B616A4CE; Mon, 29 Nov 2004 00:39:03 +0000 (GMT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D3A3343D58; Mon, 29 Nov 2004 00:39:02 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id iAT0d2Cc048929; Mon, 29 Nov 2004 00:39:02 GMT (envelope-from rwatson@repoman.freebsd.org) Received: (from rwatson@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id iAT0d2oX048928; Mon, 29 Nov 2004 00:39:02 GMT (envelope-from rwatson) Message-Id: <200411290039.iAT0d2oX048928@repoman.freebsd.org> From: Robert Watson Date: Mon, 29 Nov 2004 00:39:02 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: RELENG_5 Subject: cvs commit: src/sys/kern subr_witness.c src/sys/dev/random randomdev_soft.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 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, 29 Nov 2004 00:39:03 -0000 rwatson 2004-11-29 00:39:02 UTC FreeBSD src repository Modified files: (Branch: RELENG_5) sys/kern subr_witness.c sys/dev/random randomdev_soft.c Log: Merge randomdev_soft.c:1.5, 1.6, 1.7 from HEAD to RELENG_5: ---------------------------- revision 1.7 date: 2004/11/03 10:02:50; author: rwatson; state: Exp; lines: +11 -14 (1) Move from O(n) list copies to O(1) list concatenation, which is supported for STAILQ via STAILQ_CONCAT(). (2) Maintain a count of the number of entries in the thread-local entropy fifo so that we can keep the other fifo counts in synch. MFC after: 3 weeks MFC with: randomdev_soft.c revisions 1.5 and 1.6 Suggested by: jhb (1) ---------------------------- revision 1.6 date: 2004/10/12 14:57:14; author: rwatson; state: Exp; lines: +6 -0 Assert that the entropy source category provided by a caller submitting entropy is valid, as an invalid source will cause dereferencing of an array of queues to an incorrect memory location. ---------------------------- revision 1.5 date: 2004/10/09 22:04:13; author: rwatson; state: Exp; lines: +41 -50 Modify entropy harvesting locking strategy: - Trade off granularity to reduce overhead, since the current model doesn't appear to reduce contention substantially: move to a single harvest mutex protecting harvesting queues, rather than one mutex per source plus a mutex for the free list. - Reduce mutex operations in a harvesting event to 2 from 4, and maintain lockless read to avoid mutex operations if the queue is full. - When reaping harvested entries from the queue, move all entries from the queue at once, and when done with them, insert them all into a thread-local queue for processing; then insert them all into the empty fifo at once. This reduces O(4n) mutex operations to O(2) mutex operations per wakeup. In the future, we may want to look at re-introducing granularity, although perhaps at the granularity of the source rather than the source class; both the new and old strategies would cause contention between different instances of the same source (i.e., multiple network interfaces). Reviewed by: markm Also merge subr_witness.c:1.182 from HEAD to RELENG_5: date: 2004/10/11 08:26:18; author: rwatson; state: Exp; lines: +1 -2 Add entropy harvest mutex to hard-coded spin lock witness lock order, remove previous entropy harvesting mutex names as they are no longer present. Commit to this file was ommitted when randomdev_soft.c:1.5 was made. Feet shot: Robert Huff Revision Changes Path 1.4.2.2 +52 -58 src/sys/dev/random/randomdev_soft.c 1.178.2.3 +1 -2 src/sys/kern/subr_witness.c