From 991611163612eab2e56ea822d742ad298d999764 Mon Sep 17 00:00:00 2001 From: Xingjun Liu Date: Wed, 26 May 2021 16:26:35 +0800 Subject: [PATCH] alinux: random: speed up the initialization of module anolis inclusion from anolis_master commit 7afda44c8a9e043f8f16dcc57dd8ef615522e2c8 category: performance bugzilla: NA CVE: NA --------------------------- alinux: 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: Xingjun Liu Reviewed-by: Liu Jiang Reviewed-by: Caspar Zhang Reviewed-by: Jia Zhang Reviewed-by: Yang Shi Reviewed-by: Liu Bo Signed-off-by: Chen Jialong Reviewed-by: Xiu Jianfeng Reviewed-by: Ziyuan Hu Signed-off-by: Yang Yingliang --- drivers/char/random.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/char/random.c b/drivers/char/random.c index 401a2cce29ef..280ba163cf8b 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -1269,7 +1269,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; r = &input_pool; -- GitLab