On 16/04/15(Thu) 16:06, attila wrote: > [...] > After this was committed I received a critique of the driver from the > person behind the Alea II (Andreas Gustafsson) who made a few pretty > good points. He felt trying to pull all the entropy off of the device > that would theoretically be available every second was a losing > strategy for several reasons. Most importantly I ended up calling > add_true_randomness() in bursts of 3200 calls every trip through > ualea_task() whereas rnd_event_space[] in rnd.c only has 64 entries on > a 32bit machine (42 on amd64); this almost surely means that the vast > majority of my calls are no-ops... not so useful, it appears. > > The attached diff cranks the buffer size way down and now we call > add_true_randomness() 32 times every 100ms. When I crank ALEA_MSECS > below 100ms I start to notice the load increases on the machine with > an Alea II plugged in. I guess this is because the stuff that happens > in ualea_task() happens in the context of a process and that process > always appears to be runnable when ALEA_MSECS is e.g. 10ms. I crank > the read timeout up to 5000ms because that's what he recommends in his > sample code; under normal circumstances we never time out. > > The diff also explicitly looks for endpoint #1 because that's the > endpoint that Andreas says to use, not necc. the first one that I > find; as it turns out now the first one I find is the right one but > just to be safe it's better to check explicitly. > > Maybe now this is closer to production-worthy. All feedback and > comments most welcome.
Applied, thanks. Just one note, I had to apply your diff by hand because your MUA changes the tab into space. If you can change that for the next diff that would be great!