Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3856638pxb; Tue, 10 Nov 2020 01:38:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJwgrhzJO70KPairjMc6o1TjSROvpbL7CWWECQmuKF+E+a2U9lKuPPdVhG6NUo7BRa/JfCKF X-Received: by 2002:aa7:d2d9:: with SMTP id k25mr19469471edr.310.1605001099170; Tue, 10 Nov 2020 01:38:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605001099; cv=none; d=google.com; s=arc-20160816; b=I/e3UgUcb/KQKy5mEIvHBqD/ODn8WpccfJWLbYyH6NMgJeX1uPCS1M8gKmll6dC5m1 Qtej6pMSZTZOghmqQ1GGkRv25ngSVAWjqyTTFKuN7ed/ZbyolelddQcSZWcOr3kIejwP KAFgUTUEaQ9m8z79SoE5c8E14SszAE1d6lMqPIgkx08ncn0/7cizRuKUfsx6AJGleeR1 pCdV4g5V6Mwn48P1DNmV5ZuRudmiM0kXc+nkDxh/DHYJ/vfzOgJTS5WDfm2F2aBl71Vt EZWlc8msgBW/pwTjLppEz3p2buUGOkNRbSdGb2lcTb7IXuW4H2LzIXROtqe34g2lkiBR /0Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=etlHEC1dZUAPPHAbHc2k3VeYh8HGVD2ZKTuP6xtAVes=; b=MdKTAHuHYnlhJ4pG7FwgQFi79Nt9Mpo9z2AAjQ6V7TFilM8EEjRT5m6OKiPkWOgeM+ ByBaePPJqSpOm+rgAeeGfhN+ouAnzjlrWkARjEO4bWhZULak3g81qJqCV0LqWSPYGWxO q1BqTEgtOnLckNCP0TfJQt4pg64e+yhqiX+t2LBv6IBTuWFhOQcKtQKezvtf9jn3ball 2S1Bwt36Vy1KnuS/VLGDlZ/CXF6wWmz2ygJlz/LKyQl8GAxGNEoSXoALngXzFCized+/ QrMl8oDEizYmUsfW2pg5cTOcItXU8vyUIe6qLtXpmE1oFWYMqpwBNQGI3Mekh8pv1ndx 3tGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 94si9372293edq.570.2020.11.10.01.37.48; Tue, 10 Nov 2020 01:38:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729441AbgKJJhG (ORCPT + 99 others); Tue, 10 Nov 2020 04:37:06 -0500 Received: from mx3.molgen.mpg.de ([141.14.17.11]:60451 "EHLO mx1.molgen.mpg.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727991AbgKJJhG (ORCPT ); Tue, 10 Nov 2020 04:37:06 -0500 Received: from [192.168.0.2] (ip5f5af431.dynamic.kabel-deutschland.de [95.90.244.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id 20E712064712F; Tue, 10 Nov 2020 10:37:03 +0100 (CET) Subject: Re: jitterentropy: `jent_mod_init()` takes 17 ms To: Stephan Mueller , Herbert Xu , "David S. Miller" Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org References: <02fa159f-4f94-cfb7-1f88-bed91c6542a1@molgen.mpg.de> <4825077.WBkqHH8m98@tauon.chronox.de> From: Paul Menzel Message-ID: Date: Tue, 10 Nov 2020 10:37:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.1 MIME-Version: 1.0 In-Reply-To: <4825077.WBkqHH8m98@tauon.chronox.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Dear Stephan, Thank you for the quick reply. Am 10.11.20 um 10:25 schrieb Stephan Mueller: > Am Montag, 9. November 2020, 20:31:02 CET schrieb Paul Menzel: >> By mistake I built `XFRM_ESP` into the Linux kernel, resulting in >> >> CONFIG_CRYPTO_SEQIV=y >> CONFIG_CRYPTO_ECHAINIV=y >> >> and also the Jitterentropy RNG to be built in. >> >> CRYPTO_JITTERENTROPY=y >> >> So, on the Asus F2A85-M PRO starting Linux 4.10-rc3 with >> `initcall_debug`, the init method is run unconditionally, and it takes >> 17.5 ms, which is over ten percent of the overall 900 ms the Linux > > Hm, 17.5 / 900 = 2%, or am I missing something? Indeed, that is embarrassing. My bad. >> kernel needs until loading the init process. >> >> [ 0.300544] calling jent_mod_init+0x0/0x2c @ 1 >> [ 0.318438] initcall jent_mod_init+0x0/0x2c returned 0 after 17471 usecs >> >> Looking at the output of systemd-bootchart, it looks like, that this >> indeed delayed the boot a little, as the other init methods seem to be >> ordered after it. >> >> I am now building it as a module, but am wondering if the time can be >> reduced to below ten milliseconds. > > What you see is the test whether the Jitter RNG has a proper noise source. The > function jent_entropy_init() is the cause of the operation. It performs 1024 > times a test to validate the appropriateness of the noise source. You can > adjust that with the TESTLOOPCOUNT in this function. But I am not sure > adjusting is a wise course of action. Out of curiosity, why 1024 and not, for example, 128 or 2048? Is there some statistics behind it? Kind regards, Paul