All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Mackall <mpm@selenic.com>
To: Simon Derr <Simon.Derr@bull.net>
Cc: Yura Pakhuchiy <pakhuchiy@iptel.by>,
	Patrice Martinez <patrice.martinez@ext.bull.net>,
	linux-kernel@vger.kernel.org
Subject: Re: /dev/random problem on 2.6.12-rc1
Date: Fri, 8 Apr 2005 00:55:32 -0700	[thread overview]
Message-ID: <20050408075532.GX3174@waste.org> (raw)
In-Reply-To: <Pine.LNX.4.61.0504080817370.15652@openx3.frec.bull.fr>

On Fri, Apr 08, 2005 at 08:56:51AM +0200, Simon Derr wrote:
> On Thu, 7 Apr 2005, Matt Mackall wrote:
> 
> > On Thu, Apr 07, 2005 at 05:36:59PM +0200, Simon Derr wrote:
> > > 
> > > 
> > > On Thu, 7 Apr 2005, Yura Pakhuchiy wrote:
> > > 
> > > > On Thu, 2005-04-07 at 14:40 +0200, Patrice Martinez wrote:
> > > > > When  using a machine with a  2612-rc 1kernel, I encounter problems
> > > > > reading /dev/random:
> > > > >  it simply nevers returns anything, and the process is blocked in the
> > > > > read...
> > > > > The easiest way to see it is to type:
> > > > >  od < /dev/random
> > > > >
> > > > > Any idea?
> > > >
> > > > Because, /dev/random use user input, mouse movements and other things to
> > > > generate next random number. Use /dev/urandom if you want version that
> > > > will never block your machine.
> > > >
> > > > Read "man 4 random" for details.
> > > >
> > > Something changed since previous versions of the kernel, I guess.
> > > Running `find /usr | wc' on a ssh session generates both network and disk
> > > activity, and you should not expect any other kind of input on a networked
> > > server.
> > 
> Oops, the command is actually "find /usr | xargs wc", witch causes lots of 
> disk activity.
> 
> > FYI, network activity only generates entropy on a very small subset of
> > NICs, and probably not the one you're using. This is good, as network
> > activity is assumed passively observable/timable.
> Offtopic, but why isn't the policy the same for all NICs ?

The policy is the same, it just hasn't been implemented. SA_RANDOM
is scheduled for abolishment.
  
> > > Anyway, still zero bytes coming from /dev/random, for the few minutes I
> > > waited.
> > 
> > Are you and Patrice both experiencing this on the same machine? 
> Both IA-64, but that's the only common point.
> 
> > What
> > was the last kernel that was known to work for you? Do you see the
> > contents of /proc/sys/kernel/random/entropy_avail change over time?
> > Are there any other entropy consumers on your machine?
> None that I am aware of.
> 
> I run:
> # dd if=/dev/random bs=1 count=1 | od

strace the dd process, please. This works fine here.
  
> Another shell:
> # lsof /dev/random
> COMMAND  PID USER   FD   TYPE DEVICE SIZE  NODE NAME
> dd      1496 root    0r   CHR    1,8      99952 /dev/random
> 
> Now, find /usr | xargs wc running in background.
> 
> About /proc/sys/kernel/random/entropy_avail:
> (5 second refresh interval)

That may not be sufficient resolution. The upper layers will pull from
it whenever it rises above 64 and bash it back down to within 7 bits
of 0. What does it do when no one is reading from it?

-- 
Mathematics is the supreme nostalgia of our time.

  reply	other threads:[~2005-04-08  8:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-07 12:40 /dev/random problem on 2.6.12-rc1 Patrice Martinez
2005-04-07 13:08 ` Yura Pakhuchiy
2005-04-07 13:14 ` Yura Pakhuchiy
2005-04-07 15:36   ` Simon Derr
2005-04-07 21:12     ` Matt Mackall
2005-04-08  6:56       ` Simon Derr
2005-04-08  7:55         ` Matt Mackall [this message]
2005-04-08 12:12           ` buggy ia64_fls() ? (was Re: /dev/random problem on 2.6.12-rc1) Simon Derr
2005-04-08 16:27             ` Matt Mackall

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=20050408075532.GX3174@waste.org \
    --to=mpm@selenic.com \
    --cc=Simon.Derr@bull.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pakhuchiy@iptel.by \
    --cc=patrice.martinez@ext.bull.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.