Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5906411ybe; Tue, 10 Sep 2019 10:33:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqx8MbY6rHJAiJaa7Mrp3Ou/Z4NmR9d/ZOWBQ2UAmCZIjuNVlwFMXKGA6Lg9ZBekpbP+kgFN X-Received: by 2002:aa7:d696:: with SMTP id d22mr32016368edr.135.1568136835496; Tue, 10 Sep 2019 10:33:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568136835; cv=none; d=google.com; s=arc-20160816; b=ZmSPxVL+bAGXeQMVZDTP6xfCpkWTa6jdSPhM7qzEB9G1KiD/tB7o6N9RXJohhdQ7nD 2vULj9VCWXV98K/JzFUaXsMk1rB0+LqKPGdpxhmTFH9kr3LidR5VCzlDktHVoRQnCnNs sWAcHhDCluEJsNvmFIJsHtSF5Ybqb5+QCVxIdxW1U+bfWwwiLDaKmYvsLrflq6KCzgOg 798O2rIC5bfF+xz3nG566cNpOKW9EMJ5a9R8qxb4PjMohkS9Ws0GKsqJpOBg72a1+gBN cbxSrv1KduW9h+oaULNm+GA6LyG/c6XDyB8jzYKbaFA7iwdv7x2Hv5rmOlSKA6RzHr+K 4gbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Wt5JeczPrCBzCgehywueQJ61lZygPQJ472U+kIhvLrQ=; b=J24GiCdpWPW6zyyPFZlcg3XtZ2gVUKXRpVzt3AJra7aKgCkpdTpNZdLjUaHbd3VH2l 9aJCiJqDmjCOoKarnQ5EgCyRoWfvW9F4J8x+p8IMeFd5KhhlNWFOKPE2CuTjNL+CMfhv CMS1So/iOZZkaAU68hEO42sBUyQXzc7efZlCzXEcCcBCHGmSXFFKfBegopkQHLH/a6C4 0/qjMExeint/LFvnXpFiQkCZ0ZmOVT2hu2l9WwFVKA8m/j3wUifeOZ4U0qvbjUnzaI0F RWCwcUnRmkpkjpAdElOwgggmOnPg+d59R4b5vmpU3C3ie1z+Pl3LE9CqlYz+9U8BGpjX yilA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MgjPgu1d; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v10si74979edc.224.2019.09.10.10.33.20; Tue, 10 Sep 2019 10:33:55 -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=@gmail.com header.s=20161025 header.b=MgjPgu1d; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437052AbfIJRdR (ORCPT + 99 others); Tue, 10 Sep 2019 13:33:17 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:36812 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436774AbfIJRdR (ORCPT ); Tue, 10 Sep 2019 13:33:17 -0400 Received: by mail-wm1-f68.google.com with SMTP id p13so492731wmh.1; Tue, 10 Sep 2019 10:33:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Wt5JeczPrCBzCgehywueQJ61lZygPQJ472U+kIhvLrQ=; b=MgjPgu1diPg/vU26ZJEZ4SaIsGlgvuk87hug7Apxetu4ogdIBFhtK7fOez+vO9hgYv Iw474Le88m62b9l9kMEuMpo06G8GVRd7JMSFsz/fbo7uOLUbV92+DMuWOn9QD72vYogO 3SvdPYAW7cBmmZEz6/0ZDOKcStVrIG1PNuFbAatjfUcWcEs3L4NNRJbfCKv9OO9yWCTx 1JKqidVSrzGQ4jWdDluZ24Bb6ettRk8Qo9/qDAQbfWA0ONz/uez4HS4o5VKlTf1jQj+l U7TF1JazfDxx6avjv9BrgjuMhjEgFiuNc4VM2ySTzqd0wa7/nSr9sVih8Ppor4oCA4AK sc/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Wt5JeczPrCBzCgehywueQJ61lZygPQJ472U+kIhvLrQ=; b=kz6v9LxYN/2/tn8/N0W+O6TNmltRVc3LA7U4+abgBsaRQXe8d9XoIb2iQuoHY/KJQA fHfnW9rXtQnfcw3QR+O8/WkzTYHgW6CrwIxc0sd2L7thHDPRPOtc+uxNXhvNHyT+9NWp 7mqtwDt3AO+xD9DPkBdGk2vQuaNwP4FlNuFwbAbQ6GP8Cs8EFfVB49PRFvM1QVSteL99 u2dT6lDOdLKjoBWWeB0YnyMqqFTKBe9hoM2kJrZSpMu5XOFGIw8t14fiLn7fkFkKYPjr mOEXb9RzNfwMDSL8P4alNL+pZta2BwzySW9yC1ET/2nVLlGYW1Rq65y5zW4DJ60X3F/5 9ckQ== X-Gm-Message-State: APjAAAXyvnOqG/m4SGn74YblASSm+qYCcGZvmkJB/35ii8bc8Ci/sLb4 ziBq/k80OMf3blACSSU0loo= X-Received: by 2002:a1c:ef14:: with SMTP id n20mr520579wmh.89.1568136793312; Tue, 10 Sep 2019 10:33:13 -0700 (PDT) Received: from darwi-home-pc (p200300D06F2D144910CD9D07D5336EC2.dip0.t-ipconnect.de. [2003:d0:6f2d:1449:10cd:9d07:d533:6ec2]) by smtp.gmail.com with ESMTPSA id n7sm17956584wrx.42.2019.09.10.10.33.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2019 10:33:12 -0700 (PDT) Date: Tue, 10 Sep 2019 19:33:04 +0200 From: "Ahmed S. Darwish" To: Linus Torvalds Cc: Theodore Ts'o , Andreas Dilger , Jan Kara , Ray Strode , William Jon McCann , zhangjs , linux-ext4@vger.kernel.org, lkml Subject: Re: Linux 5.3-rc8 Message-ID: <20190910173243.GA3992@darwi-home-pc> References: <20190910042107.GA1517@darwi-home-pc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Sep 10, 2019 at 12:33:12PM +0100, Linus Torvalds wrote: > On Tue, Sep 10, 2019 at 5:21 AM Ahmed S. Darwish wrote: > > > > The commit b03755ad6f33 (ext4: make __ext4_get_inode_loc plug), [1] > > which was merged in v5.3-rc1, *always* leads to a blocked boot on my > > system due to low entropy. > > Exactly what is it that blocks on entropy? Nobody should do that > during boot, because on some systems entropy is really really low > (think flash memory with polling IO etc). > Ok, I've tracked it down further. It's unfortunately GDM intentionally blocking on a getrandom(buf, 16, 0). Booting the system with an straced GDM service ("ExecStart=strace -f /usr/bin/gdm") reveals: ... [ 3.779375] strace[262]: [pid 323] execve("/usr/lib/gnome-session-binary", ... /* 28 vars */) = 0 ... [ 4.019227] strace[262]: [pid 323] getrandom( [ 79.601433] kernel: random: crng init done [ 79.601443] kernel: random: 3 urandom warning(s) missed due to ratelimiting [ 79.601262] strace[262]: [pid 323] <... getrandom resumed>..., 16, 0) = 16 [ 79.601262] strace[262]: [pid 323] getrandom(..., 16, 0) = 16 [ 79.603041] strace[262]: [pid 323] getrandom(..., 16, 0) = 16 [ 79.603041] strace[262]: [pid 323] getrandom(..., 16, 0) = 16 [ 79.603041] strace[262]: [pid 323] getrandom(..., 16, 0) = 16 As can be seen in the timestamps, the GDM boot was only continued by typing randomly on the keyboard.. > That said, I would have expected that any PC gets plenty of entropy. > Are you sure it's entropy that is blocking, and not perhaps some odd > "forgot to unplug" situation? > Yes, doing any of below steps makes the problem reliably disappear: - boot param "random.trust_cpu=on" - rngd(8) enabled at boot (entropy source: x86 RDRAND + jitter) - pressing random 3 or 4 keyboard keys while GDM boot is stuck > > Can this even be considered a user-space breakage? I'm honestly not > > sure. On my modern RDRAND-capable x86, just running rng-tools rngd(8) > > early-on fixes the problem. I'm not sure about the status of older > > CPUs though. > > It's definitely breakage, although rather odd. I would have expected > us to have other sources of entropy than just the disk. Did we stop > doing low bits of TSC from timer interrupts etc? > Exactly. While gnome-session is obviously at fault here by requiring *blocking* randomness at the boot path, it's still not requesting much, just (5 * 16) bytes to be exact. I guess an x86 laptop should be able to provide that, even without RDRAND / random.trust_cpu=on (TSC jitter, etc.) ? thanks, --darwi > Ted, either way - ext4 IO patterns or random number entropy - this is > your code. Comments? > > Linus