Re: [PATCH 6/7] lib/random32.c: Randomize timeout to the millisecond, not the second

2014-06-08 Thread Daniel Borkmann
On 06/08/2014 02:42 PM, George Spelvin wrote: Note, when you talk about efficiency here, this is called once every 40+ secs ... ;) Agreed, in this case the code size saving (avoid a function call) is the main benefit. And I prefer to avoid inefficiency on general priinciples, if it's not servi

Re: [PATCH 6/7] lib/random32.c: Randomize timeout to the millisecond, not the second

2014-06-08 Thread George Spelvin
> Note, when you talk about efficiency here, this is called once every > 40+ secs ... ;) Agreed, in this case the code size saving (avoid a function call) is the main benefit. And I prefer to avoid inefficiency on general priinciples, if it's not serving some other goal. -- To unsubscribe from th

Re: [PATCH 6/7] lib/random32.c: Randomize timeout to the millisecond, not the second

2014-06-08 Thread Daniel Borkmann
On 06/08/2014 01:30 PM, George Spelvin wrote: Fine by me this cleanup, although not strictly needed. Agreed. The timer slack is set to HZ (1 second) anyway. It just dawned on me that a simpler and more efficient way to do this (which I'll do in v2 of this) would be: Note, when you talk abou

Re: [PATCH 6/7] lib/random32.c: Randomize timeout to the millisecond, not the second

2014-06-08 Thread George Spelvin
> Fine by me this cleanup, although not strictly needed. Agreed. The timer slack is set to HZ (1 second) anyway. It just dawned on me that a simpler and more efficient way to do this (which I'll do in v2 of this) would be: /* reseed every ~60 seconds, in [40 .. 80) interval with slack *

Re: [PATCH 6/7] lib/random32.c: Randomize timeout to the millisecond, not the second

2014-06-08 Thread Daniel Borkmann
On 06/07/2014 10:28 AM, George Spelvin wrote: If you're going to bother randomizing it, do it right. And use prandom_u32_max(), which is designed for the job, rather than "% 40". Signed-off-by: George Spelvin Fine by me this cleanup, although not strictly needed. --- lib/random32.c | 6 ++

[PATCH 6/7] lib/random32.c: Randomize timeout to the millisecond, not the second

2014-06-07 Thread George Spelvin
If you're going to bother randomizing it, do it right. And use prandom_u32_max(), which is designed for the job, rather than "% 40". Signed-off-by: George Spelvin --- lib/random32.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/random32.c b/lib/random32.c index ee