All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sandy Harris <sandyinchina@gmail.com>
To: linux-crypto@vger.kernel.org
Subject: random(4) overheads question
Date: Mon, 26 Sep 2011 14:41:11 +0800	[thread overview]
Message-ID: <CACXcFmmXrP4+1ZpG-vmda2agVCTKW7uMa08LLisTy+xfjzA04w@mail.gmail.com> (raw)

I'm working on a demon that collects timer randomness, distills it
some, and pushes the results into /dev/random.

My code produces the random material in 32-bit chunks. The current
version sends it to /dev/random 32 bits at a time, doing a write() and
an entropy-update ioctl() for each chunk. Obviously I could add some
buffering and write fewer and larger chunks. My questions are whether
that is worth doing and, if so, what the optimum write() size is
likely to be.

I am not overly concerned about overheads on my side of the interface,
unless they are quite large. My concern is whether doing many small
writes wastes kernel resources.

                 reply	other threads:[~2011-09-26  6:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=CACXcFmmXrP4+1ZpG-vmda2agVCTKW7uMa08LLisTy+xfjzA04w@mail.gmail.com \
    --to=sandyinchina@gmail.com \
    --cc=linux-crypto@vger.kernel.org \
    /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.