From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: Andi Kleen <andi@firstfloor.org>
Cc: tytso@mit.edu, linux-kernel@vger.kernel.org,
Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH 1/3] Make /dev/urandom scalable
Date: Wed, 30 Sep 2015 16:40:23 +0200 [thread overview]
Message-ID: <874mickm20.fsf@rasmusvillemoes.dk> (raw)
In-Reply-To: <1443115148-13937-2-git-send-email-andi@firstfloor.org> (Andi Kleen's message of "Thu, 24 Sep 2015 10:19:06 -0700")
On Thu, Sep 24 2015, Andi Kleen <andi@firstfloor.org> wrote:
>
> v2: Fix name of pool 0. Fix race with interrupts. Make
> iteration loops slightly more efficient. Add ifdefs to avoid
> any extra code on non-NUMA. Delay other pool use to when
> the original pool initialized and initialize the pools from
> pool 0. Add comments on memory allocation.
More bikeshedding. Please ignore unless you do a v3 anyway.
> static struct entropy_store nonblocking_pool = {
> .poolinfo = &poolinfo_table[1],
> - .name = "nonblocking",
> + .name = "nonblocking pool 0",
Hm, yeah, but then you should probably also update the blocking pool's
name (or use the format "nonblocking %d").
> +#define POOL_INIT_BYTES (128 / 8)
> +
> +void init_node_pools(void)
> +{
> +#ifdef CONFIG_NUMA
> + int i;
> + for (i = 0; i < num_possible_nodes(); i++) {
int num_nodes = num_possible_nodes();
for (i = 0; i < num_nodes; i++) {
> static long random_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
> {
> + int i;
> int size, ent_count;
> int __user *p = (int __user *)arg;
> int retval;
> + struct entropy_store *pool;
>
> switch (cmd) {
> case RNDGETENTCNT:
> @@ -1569,6 +1696,10 @@ static long random_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
> return -EPERM;
> input_pool.entropy_count = 0;
> nonblocking_pool.entropy_count = 0;
> + if (nonblocking_node_pool)
> + for_each_nb_pool (i, pool) {
> + pool->entropy_count = 0;
> + } end_for_each_nb();
extra ;. harmless in this case, but could cause slightly hard-to-understand build
failures if that if grows an else.
Rasmus
next prev parent reply other threads:[~2015-09-30 14:40 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-24 17:19 Updated scalable urandom patchkit Andi Kleen
2015-09-24 17:19 ` [PATCH 1/3] Make /dev/urandom scalable Andi Kleen
2015-09-30 14:40 ` Rasmus Villemoes [this message]
2015-09-24 17:19 ` [PATCH 2/3] random: Make input to output pool balancing per cpu Andi Kleen
2015-09-24 17:19 ` [PATCH 3/3] random: Add pool name to urandom_read trace point Andi Kleen
-- strict thread matches above, loose matches on Subject: below --
2016-03-01 5:17 [PATCH 1/3] Make /dev/urandom scalable Andi Kleen
2016-02-10 23:01 Scalable random patchkit revisited Andi Kleen
2016-02-10 23:01 ` [PATCH 1/3] Make /dev/urandom scalable Andi Kleen
2015-10-06 22:05 Andi Kleen
2015-09-22 23:16 Andi Kleen
2015-09-22 23:25 ` Andi Kleen
2015-09-23 10:32 ` Rasmus Villemoes
2015-09-23 21:54 ` Andi Kleen
2015-09-23 19:40 ` Austin S Hemmelgarn
2015-09-23 23:28 ` Andi Kleen
2015-09-24 11:37 ` Austin S Hemmelgarn
2015-09-24 13:12 ` Theodore Ts'o
2015-09-24 16:00 ` Austin S Hemmelgarn
2015-09-24 16:52 ` Jeff Epler
2015-09-24 19:11 ` Austin S Hemmelgarn
2015-09-24 20:00 ` Jeff Epler
2015-09-24 20:14 ` Theodore Ts'o
2015-09-25 11:41 ` Austin S Hemmelgarn
2015-09-25 19:07 ` Austin S Hemmelgarn
2015-09-25 20:24 ` Theodore Ts'o
2015-09-29 12:06 ` Austin S Hemmelgarn
2015-09-29 11:57 ` Austin S Hemmelgarn
2015-09-23 21:10 ` Theodore Ts'o
2015-09-23 21:25 ` Andi Kleen
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=874mickm20.fsf@rasmusvillemoes.dk \
--to=linux@rasmusvillemoes.dk \
--cc=ak@linux.intel.com \
--cc=andi@firstfloor.org \
--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
Powered by JetHome