From owner-svn-src-projects@FreeBSD.ORG Mon Feb 24 11:01:19 2014 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21A983E4; Mon, 24 Feb 2014 11:01:19 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9B58A1563; Mon, 24 Feb 2014 11:01:17 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.8/8.14.8) with ESMTP id s1OB19rd008045 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 24 Feb 2014 15:01:09 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.8/8.14.8/Submit) id s1OB19V7008044; Mon, 24 Feb 2014 15:01:09 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 24 Feb 2014 15:01:09 +0400 From: Gleb Smirnoff To: Mark Murray Subject: Re: svn commit: r262380 - projects/random_number_generator/sys/dev/random Message-ID: <20140224110109.GO86937@FreeBSD.org> References: <201402231849.s1NInrvj073433@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201402231849.s1NInrvj073433@svn.freebsd.org> User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-projects@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Feb 2014 11:01:19 -0000 Mark, On Sun, Feb 23, 2014 at 06:49:53PM +0000, Mark Murray wrote: M> Author: markm M> Date: Sun Feb 23 18:49:52 2014 M> New Revision: 262380 M> URL: http://svnweb.freebsd.org/changeset/base/262380 M> M> Log: M> Remove STAILQ manipulations from the harvest path. This will be a lot more friendly to the critical bits of the kernel. ... M> +/* M> + * Lockable FIFO ring buffer holding entropy events M> + * If ring_in == ring_out, M> + * the buffer is empty. M> + * If (ring_in + 1) == ring_out (MOD RANDOM_FIFO_MAX), M> + * the buffer is full. M> + */ M> +static struct entropyfifo { M> + struct harvest_event ring[RANDOM_FIFO_MAX]; M> + volatile u_int ring_in; M> + volatile u_int ring_out; M> +} entropyfifo; Would buf_ring(9) do the job? If not, may be it is worth to bring it to a state that would suffice your needs, instead of making another implementation? -- Totus tuus, Glebius.