From: Greg Price <price@MIT.EDU>
To: "Theodore Ts'o" <tytso@MIT.EDU>
Cc: linux-kernel@vger.kernel.org
Subject: [3.13 PATCH 0/2] random: bytes vs. bits
Date: Fri, 6 Dec 2013 21:27:42 -0500 [thread overview]
Message-ID: <cover.1386382885.git.price@mit.edu> (raw)
The new when-to-push logic in v3.13-rc1~61^2~6 "random: push extra
entropy to the output pools" uses the name "entropy_bytes" for a
quantity that's actually in bits. This results in confusing,
buggy-looking lines both where the variable is set and where it's
used. Fortunately it's all consistent if the variable is understood
as counting bits, so the behavior is fine.
This code is new in v3.13-rc1, so fixing the name seems in order for
3.13. The first patch here just does that.
One cause of the mistake is probably that the names of
random_read_wakeup_thresh and random_write_wakeup_thresh don't
indicate what units they're in. This is an especially acute issue now
that we have three units for entropy in different places -- bytes,
bits, and 1 / (1 << ENTROPY_SHIFT) fractions of a bit. The second
patch clarifies the units in both names. (Maybe other names should be
clarified too.) This may as well be post-3.13.
Cheers,
Greg
Greg Price (2):
random: entropy_bytes is actually bits
random: clarify bits/bytes in wakeup thresholds
drivers/char/random.c | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
--
1.8.3.2
next reply other threads:[~2013-12-07 2:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-07 2:27 Greg Price [this message]
2013-12-07 2:27 ` [3.13 PATCH 1/2] random: entropy_bytes is actually bits Greg Price
2013-12-07 14:50 ` Theodore Ts'o
2013-12-07 2:28 ` [PATCH 2/2] random: clarify bits/bytes in wakeup thresholds Greg Price
2013-12-07 19:20 ` Theodore Ts'o
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=cover.1386382885.git.price@mit.edu \
--to=price@mit.edu \
--cc=linux-kernel@vger.kernel.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