LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Fix add_timer_randomness throttling
@ 2015-02-04 14:00 Torsten Duwe
  2015-02-23 10:45 ` [RESEND][PATCH] " Torsten Duwe
  0 siblings, 1 reply; 2+ messages in thread
From: Torsten Duwe @ 2015-02-04 14:00 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: H. Peter Anvin, lkml

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;
 


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [RESEND][PATCH] Fix add_timer_randomness throttling
  2015-02-04 14:00 Fix add_timer_randomness throttling Torsten Duwe
@ 2015-02-23 10:45 ` Torsten Duwe
  0 siblings, 0 replies; 2+ messages in thread
From: Torsten Duwe @ 2015-02-23 10:45 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: H. Peter Anvin, lkml

[now with "PATCH" tag]

It looks to me that commit a283b5c459784f97 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;
 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-02-23 10:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-04 14:00 Fix add_timer_randomness throttling Torsten Duwe
2015-02-23 10:45 ` [RESEND][PATCH] " Torsten Duwe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).