提交 e1064533 编写于 作者: X Xingjun Liu 提交者: Joseph Qi

random: speed up the initialization of module

During the module initialization phase, entropy will be added
to entropy pool for every interrupt, the change should speed up
initialization of the random module.

Before optimization:
[   22.180236] random: crng init done

After optimization:
[    1.474832] random: crng init done
Signed-off-by: NXingjun Liu <xingjun.lxj@alibaba-inc.com>
Reviewed-by: NLiu Jiang <gerry@linux.alibaba.com>
Reviewed-by: NCaspar Zhang <caspar@linux.alibaba.com>
Reviewed-by: jia zhang's avatarJia Zhang <zhang.jia@linux.alibaba.com>
Reviewed-by: NYang Shi <yang.shi@linux.alibaba.com>
Reviewed-by: NLiu Bo <bo.liu@linux.alibaba.com>
上级 8c233ea3
......@@ -1306,7 +1306,8 @@ void add_interrupt_randomness(int irq, int irq_flags)
}
if ((fast_pool->count < 64) &&
!time_after(now, fast_pool->last + HZ))
!time_after(now, fast_pool->last + HZ) &&
crng_ready())
return;
if (!seed_inited) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册