Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp881762iob; Wed, 4 May 2022 09:49:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwT5yqLrQkhcRizKSP9Fl5UFd4oWpbz5WXwNMSb+LlUlqB0Ptzed3ks55cFMrmV9bKlAj8q X-Received: by 2002:a17:907:72c4:b0:6f4:ad52:b9fd with SMTP id du4-20020a17090772c400b006f4ad52b9fdmr5488787ejc.128.1651682984489; Wed, 04 May 2022 09:49:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651682984; cv=none; d=google.com; s=arc-20160816; b=YtkPkaEh+iNx/SuCwFO9IIiTpodR2WekAzErfa+h8SuDvJbCdazSBTwstp15dc99y6 yJsDq3jVEmeFQTXu6dySRlI95ezCdOh6N9LFoS5Ca+8ojBEfrjbf/2cUWAchdsGAh84L 7vCoW0G2SiQu4QIQqSEPXYkpMN71AZS6x2/1Ptel7w4aU6SaZBEy3srrtlPKB49ReJRA ho64jMtFQ4di+v6qTAOd9rCwD+JwJJlxYCcONNuo+lEaNZvl5zjv2B66gm7qzwYSJCRT nceLUeLxRKzOUXJUsEVDl7ZyBwttcLNuhCXlRmEgawDNTCh0OCqURxPhysO/dUmaoz8R g/nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=JtDvx1159fbzYrisyZ9ZY0g7ncNoctFRF9XV2PvxEqk=; b=KjrnCbO1hX7M5EhuvFVrPG7SM4I0nBSWf+zsXH4UBDCth56Ie8ELd2QtQxwS2Jq3GG uflsHs5LlB+vC2/aqBuXAvmnCzHZktqkw70Qxsx0h3PTVcETYvjK9Bd5soCLnXVjb9IV BJ9Wgw7GrOzdpVP5CCMc32eQPM4IuL2urYS2YF8PkBPS2cBeQkqdRZ3H59g9Ed1DLcSd xjxF5iqzZjBrF6aleh69b19KtAAHIyUjos4kmBTfvWSN3gQCpwWtDYoNLktUASJpMsW3 bkd0LQc/+OxF7NXOv3MPkdEVt/RGzhm8k5mrJKoxzrwxbyaSxJO3ZUHd4Amuhur9lemk J7jA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a27-20020a056402237b00b0041ceaed91f5si15809781eda.496.2022.05.04.09.49.06; Wed, 04 May 2022 09:49:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234656AbiECUF5 (ORCPT + 99 others); Tue, 3 May 2022 16:05:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230514AbiECUF4 (ORCPT ); Tue, 3 May 2022 16:05:56 -0400 X-Greylist: delayed 352 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 03 May 2022 13:02:22 PDT Received: from isilmar-4.linta.de (isilmar-4.linta.de [136.243.71.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74E3C403C5 for ; Tue, 3 May 2022 13:02:22 -0700 (PDT) X-isilmar-external: YES X-isilmar-external: YES X-isilmar-external: YES Received: from owl.dominikbrodowski.net (owl.brodo.linta [10.2.0.111]) by isilmar-4.linta.de (Postfix) with ESMTPSA id 37783200286; Tue, 3 May 2022 19:56:27 +0000 (UTC) Received: by owl.dominikbrodowski.net (Postfix, from userid 1000) id C0BB380595; Tue, 3 May 2022 21:56:18 +0200 (CEST) Date: Tue, 3 May 2022 21:56:18 +0200 From: Dominik Brodowski To: "Jason A. Donenfeld" Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] random: mix hwgenerator randomness before sleeping Message-ID: References: <20220503195141.683217-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220503195141.683217-1-Jason@zx2c4.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Am Tue, May 03, 2022 at 09:51:41PM +0200 schrieb Jason A. Donenfeld: > The add_hwgenerator_randomness() function is called in a loop from a > kthread by the hwgenerator core. It's supposed to sleep when there's > nothing to do, and wake up periodically for more entropy. Right now it > receives entropy, sleeps, and then mixes it in. This commit reverses the > order, so that it always mixes in entropy sooner and sleeps after. This > way the entropy is more fresh. ... however, the hwgenerator may take quite some time to accumulate entropy after wakeup. So now we might have a delay between a wakeup ("we need more entropy!") and that entropy becoming available. Beforehand, the thread only went to sleep when there is no current need for "fresh" entropy. Thanks, Dominik