All of lore.kernel.org
 help / color / mirror / Atom feed
From: Torsten Duwe <duwe@lst.de>
To: "Theodore Ts'o" <tytso@mit.edu>
Cc: "H. Peter Anvin" <hpa@linux.intel.com>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Fix add_timer_randomness throttling
Date: Wed, 4 Feb 2015 15:00:29 +0100	[thread overview]
Message-ID: <20150204140029.GA2949@lst.de> (raw)

Hi Ted,

review of a backport of a283b5c459784f97 suggests to me that it has one
replacement too much: in add_timer_randomness, entropy_count is compared
to trickle_thresh, which are _both_ scaled up by ENTROPY_SHIFT. I'd therefore
revert that hunk.

Signed-off-by: Torsten Duwe <duwe@suse.de>


@@ -674,7 +697,7 @@ static void add_timer_randomness(struct timer_rand_state *state, unsigned num)
 
 	preempt_disable();
 	/* if over the trickle threshold, use only 1 in 4096 samples */
-	if (ENTROPY_BITS(&input_pool) > trickle_thresh &&
+	if (input_pool.entropy_count > trickle_thresh &&
 	    ((__this_cpu_inc_return(trickle_count) - 1) & 0xfff))
 		goto out;
 


             reply	other threads:[~2015-02-04 14:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-04 14:00 Torsten Duwe [this message]
2015-02-23 10:45 ` [RESEND][PATCH] Fix add_timer_randomness throttling Torsten Duwe

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=20150204140029.GA2949@lst.de \
    --to=duwe@lst.de \
    --cc=hpa@linux.intel.com \
    --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 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.