netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean-Luc Cooke <jlcooke@certainkey.com>
To: "David S. Miller" <davem@redhat.com>
Cc: root@chaos.analogic.com, adilger@clusterfs.com,
	shemminger@osdl.org, alan@lxorguk.ukuu.org.uk, tytso@mit.edu,
	netdev@oss.sgi.com, linux-kernel@vger.kernel.org
Subject: Re: [RFC] enhanced version of net_random()
Date: Fri, 20 Aug 2004 15:53:02 -0400	[thread overview]
Message-ID: <20040820195302.GK5806@certainkey.com> (raw)
In-Reply-To: <20040820124823.071ac1d9.davem@redhat.com>

If speed is what you want, and you want a period > 2^N.

Then a single get_rand_bytes() to fill a seed of a simple LFSR might do.

Seed value will be N+1 bits long.

Rochard's PRNG does not have a period > 2^32, that's for sure.

JLC

On Fri, Aug 20, 2004 at 12:48:23PM -0700, David S. Miller wrote:
> On Fri, 20 Aug 2004 15:22:09 -0400 (EDT)
> "Richard B. Johnson" <root@chaos.analogic.com> wrote:
> 
> > The attached code will certainly work on Intel machines. It is
> > in the public domain, having been modified by myself to produce
> > a very long sequence...
> 
> How long a period does it have?  The one we're adding to the
> networking has one which is 2^88.
> 
> > I wouldn't suggest converting it to 'C' because the rotation
> > takes many CPU instructions when one tries to do the test, shift,
> > and OR in 'C',
> 
> You only need 2 'shifts' and an 'or' to do a rotate in C.
> No tests are needed.

  reply	other threads:[~2004-08-20 19:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-12 17:48 [RFC] enhanced version of net_random() Stephen Hemminger
2004-08-12 19:48 ` David S. Miller
2004-08-13 18:51   ` Stephen Hemminger
2004-08-13 19:28     ` Andi Kleen
2004-08-16  6:27       ` David S. Miller
2004-08-12 20:02 ` Ben Greear
2004-08-20 17:59 ` Jean-Luc Cooke
2004-08-20 18:47   ` David S. Miller
2004-08-20 18:59   ` Andreas Dilger
2004-08-20 19:22     ` Richard B. Johnson
2004-08-20 19:48       ` David S. Miller
2004-08-20 19:53         ` Jean-Luc Cooke [this message]
2004-08-22 15:04         ` Andi Kleen
2004-08-23 17:05       ` Stephen Hemminger
2004-08-23 18:09         ` Richard B. Johnson
2004-08-20 21:24     ` Lee Revell
2004-08-20 23:55       ` Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040820195302.GK5806@certainkey.com \
    --to=jlcooke@certainkey.com \
    --cc=adilger@clusterfs.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.com \
    --cc=root@chaos.analogic.com \
    --cc=shemminger@osdl.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).