Date: Sat, 9 Oct 2004 22:04:13 +0000 (UTC) From: Robert Watson <rwatson@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/dev/random randomdev_soft.c Message-ID: <200410092204.i99M4Dl7026960@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
rwatson 2004-10-09 22:04:13 UTC FreeBSD src repository Modified files: sys/dev/random randomdev_soft.c Log: 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 Revision Changes Path 1.5 +41 -50 src/sys/dev/random/randomdev_soft.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200410092204.i99M4Dl7026960>