Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp3753443ybe; Mon, 16 Sep 2019 00:07:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqygmMcyf8UqAMrOmNRHk57xY6WcXRwDY/4ruKyofKCczWAdF2dTwvEMLKkXdUTo5MDzgN7U X-Received: by 2002:aa7:d698:: with SMTP id d24mr5203224edr.32.1568617651093; Mon, 16 Sep 2019 00:07:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568617651; cv=none; d=google.com; s=arc-20160816; b=wbYqZzaEbYg/rAkNuP212NprzJgQTrvYAFCJSwQiF/RMffRnHwdWJpDHFXd/x8zeIj nFGgvTP+T0Yf2K+SHPTPzSVYAd0BMhT+0MycnuNJi+BygNueRWSuliJMWkuIgA/ueiX4 skcU7DtoWqdG0GcYDpQmNSBFZeIXak7MDoFANKgJFtmtsKU07Yi2CSI6yN31tF+pJ+zc NSC1697jqObReTPyIc+3oleZZ9O5okjamzbr0U2IWnydR86NAM4cG97yBqvyzz0v/pXW mo4u1SD9CCoqG5dohdSXcwkZPNM1hJZhDGgDK87FVPDhlxHdwEzSpTqPmAUXPT90sBB0 /o9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Rq2sexGvXyylQNcdJFz5T59iDA//hf3VzmIhHtRsXOM=; b=Xjg4MMz67xbbaaU3WU1Pzci97tRIE5bu6v+b4JMC1D2YyUsYaSkXDr1sXR/Cdnyjh4 4pq7iH5ehBfqH9f8tby+Qiit3pTeiH2avQl210fDw0ZS5LaiXT+IloFO9DOQL6dxnAa9 /r9uXlQ/+X+KkFJq0dinYJ6x31hu5Ib6YS00Q7Dzi3f6s7MT73C7XqVGzYHPgOKkOLwD tPKaJ9kMuAJGXppCwGEXEivtCVtL3MlwVwc/t5D+VnLXgi/5/MVY75HleaBsSAvIy1cj VniliO8phIf1I82WE8zqDUW3FMzoLt5uKvloghG54ncYITpVT/LkSICHeOVhDooqHt+H G/vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=TS2dDRbU; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qw8si18208339ejb.74.2019.09.16.00.06.52; Mon, 16 Sep 2019 00:07:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=TS2dDRbU; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726604AbfIPEV3 (ORCPT + 99 others); Mon, 16 Sep 2019 00:21:29 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:40169 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726331AbfIPEV2 (ORCPT ); Mon, 16 Sep 2019 00:21:28 -0400 Received: by mail-lf1-f67.google.com with SMTP id d17so8429851lfa.7 for ; Sun, 15 Sep 2019 21:21:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Rq2sexGvXyylQNcdJFz5T59iDA//hf3VzmIhHtRsXOM=; b=TS2dDRbURQUMp4r1Uisuw67wWuJoMZhNT5OPAXaweTtn6/78ZH4Rpp+VPWpR7o2NR1 CboY8r7rDnKIGZ7IabPeLJ0qQ0BIXf2FzGUQw3ZtQS+i8c5fRMmwkQjWvgDauyGBly1Z erb+PTSfVUna3DOAM0EpjpQnfViDxx/7mZRjE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Rq2sexGvXyylQNcdJFz5T59iDA//hf3VzmIhHtRsXOM=; b=lod4cQnYClW+3IkBb4MW5hrJv1AkQJBxbP0p/yVVUdnAUmBO3yH87H4zXk34PDGssD xHqCjuMuo7W1vrhY3LIeiyxiYw5qVrEiqT5XusfBSA5XHph4bfSqbNyi/rJwHxHaNuKh jionb1YCCeS5rroI1PUeV1fiTs1sILixgjoQPec44rjE6/qU12z51X1t5OB6cc3AS1zN ST36Z2XPkPSF6erBvFSeNMq/57DlX21szHJyH4k1UYlNbzzuL+073XcPnzfIbAySbgVv q6TZK/0eWStX5wn9lqbRQSyv/w6Z5YY8FnmYpllzVEwLnKSpdutbeTRoM+pTvrV1rhbF sCdA== X-Gm-Message-State: APjAAAVppecB4/f09eQst4IC8QwrYyk7fQkGPR3GF/oAmbcMLrVykKTA g/iEnGYPKZ7S/vnVjzjBsZaM8ka9VTs= X-Received: by 2002:a19:f512:: with SMTP id j18mr19064502lfb.169.1568607684751; Sun, 15 Sep 2019 21:21:24 -0700 (PDT) Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com. [209.85.208.172]) by smtp.gmail.com with ESMTPSA id w16sm1588621lji.42.2019.09.15.21.21.22 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 15 Sep 2019 21:21:23 -0700 (PDT) Received: by mail-lj1-f172.google.com with SMTP id s19so1690727lji.6 for ; Sun, 15 Sep 2019 21:21:22 -0700 (PDT) X-Received: by 2002:a05:651c:1108:: with SMTP id d8mr28431238ljo.180.1568607682512; Sun, 15 Sep 2019 21:21:22 -0700 (PDT) MIME-Version: 1.0 References: <20190911160729.GF2740@mit.edu> <20190916035228.GA1767@gondor.apana.org.au> In-Reply-To: <20190916035228.GA1767@gondor.apana.org.au> From: Linus Torvalds Date: Sun, 15 Sep 2019 21:21:06 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Linux 5.3-rc8 To: Herbert Xu Cc: "Theodore Y. Ts'o" , "Ahmed S. Darwish" , Andreas Dilger , Jan Kara , Ray Strode , William Jon McCann , zhangjs , linux-ext4@vger.kernel.org, Linux List Kernel Mailing Content-Type: text/plain; charset="UTF-8" Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Sun, Sep 15, 2019 at 8:52 PM Herbert Xu wrote: > > Can we perhaps artifically increase the interrupt rate while the > CRNG is not initialised? Long term (or even medium term in some areas), the problem really is that device interrupts during boot really are going away, rather than becoming more common. That just happened to be the case now because of improved plugging, but it's fundamentally the direction any storage is moving with faster flash interfaces. The only interrupt we could easily increase the rate of in the kernel is the timer interrupt, but that's also the interrupt that is the least useful for randomness. The timer interrupt could be somewhat interesting if you are also CPU-bound on a non-trivial load, because then "what program counter got interrupted" ends up being possibly unpredictable - even with a very stable timer interrupt source - and effectively stand in for a cycle counter even on hardware that doesn't have a native TSC. Lots of possible low-level jitter there to use for entropy. But especially if you're just idly _waiting_ for entropy, you won't be "CPU-bound on an interesting load" - you'll just hit the CPU idle loop all the time so even that wouldn't work. But practically speaking timers really are not really much of an option. And if we are idle, even having a high-frequency TSC isn't all that useful with the timer interrupt, because the two tend to be very intimately related. Of course, if you're generating a host key for SSH or something like that, you could try to at least cause some network traffic while generating the key. That's not much of an option for the _kernel_, but for a program like ssh-keygen it certainly could be. Blocking is fine if you simply don't care about time at all (the "five hours later is fine" situation), or if you have some a-priori knowledge that the machine is doing real interesting work that will generate entropy. But I don't see how the kernel can generate entropy on its own, particularly during boot (which is when the problem happens), when most devices aren't even necessarily meaningfully set up yet. Hopefully hw random number generators will make this issue effectively moot before we really end up having the "nvdimms and their ilk are common enough that you really have no early boot irq-driven disk IO at all". Linus