From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 416D4C433EF for ; Wed, 13 Jul 2022 14:52:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231316AbiGMOwW (ORCPT ); Wed, 13 Jul 2022 10:52:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229654AbiGMOwW (ORCPT ); Wed, 13 Jul 2022 10:52:22 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3B4163C14D; Wed, 13 Jul 2022 07:52:21 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 708E11424; Wed, 13 Jul 2022 07:52:21 -0700 (PDT) Received: from [10.1.29.153] (e121487-lin.cambridge.arm.com [10.1.29.153]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8D1E53F73D; Wed, 13 Jul 2022 07:52:19 -0700 (PDT) Message-ID: <653f4dd9-1325-22f5-1fe0-79e0ec9d2283@arm.com> Date: Wed, 13 Jul 2022 15:52:10 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH] random: vary jitter iterations based on cycle counter speed Content-Language: en-US To: "Jason A. Donenfeld" Cc: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, Eric Biggers , Theodore Ts'o , Linus Torvalds References: <20220422132027.1267060-1-Jason@zx2c4.com> From: Vladimir Murzin In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Hi Jason, On 7/13/22 15:40, Jason A. Donenfeld wrote: > Hi Vladimir, > > On Wed, Jul 13, 2022 at 03:31:05PM +0100, Vladimir Murzin wrote: >> I've just seen on the platform with slow(ish) timer that it is now considered >> as a source of entropy with samples_per_bit set to 27 (5.19-rc6 has MAX_SAMPLES_PER_BIT >> set to 32). Because of that I see significant delays and I'm trying to understand what >> could be wrong with my setup. >> >> I observe one credit_init_bits(1) call (via entropy_timer()) per ~970 schedule() calls. >> Is that somewhat expected? Does it make sense at all? > > How slow are we talking? Seconds? Minutes? Is it too slow? It's possible > that MAX_SAMPLES_PER_BIT=32 is a bit high as a threshold and I should > reduce that a bit. > TBH, I run out of patience and never seen it completes, more then seconds. I just was curious how much it is should take to get crng_ready() return true. > Also, out of curiosity, why is your timer so slow? It is part of slow(ish) FPGA. Cheers Vladimir > > Jason