Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp235133ybe; Wed, 18 Sep 2019 16:13:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwC/GcqG4XlSGW8k1qnzlbEkX/sRXyIrSIAeO+0bInCZaVlBPFbgs1/nxfwk7+kqHakNIyP X-Received: by 2002:a50:e719:: with SMTP id a25mr13034524edn.258.1568848426952; Wed, 18 Sep 2019 16:13:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568848426; cv=none; d=google.com; s=arc-20160816; b=MjT0Ey9du3J2X9TX4ehahcmj2lnu8E0wo986tLaNGJov04WC+hfJvvbcoaUB5tIb8q ZaKjP6BoCI7B+kbEHjwzSeKN40hDxq8ULMZ8yTGCupOpA/WpuUScdi6Nuj87Nfl+txSg jRrFVeOa2IMoecmwS+aXwt80KEqQ0VDKnC2OgInriERk+fB4/S7URXoT++HngAej1D8e X909MEZWrkCMJjiduuyFWuGhRZZLc+EGBt33ztCVeWlLqliNhV3WH2iQLhz2F8H8m8ab msi+oPZjvrkjk6S1FZu2S3O3XIcYH6fl1wYU4MkHz3sedEtrhP+54CNcwdCeXVh0ZcOZ 554Q== 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=I8yXMHibszj2VHQlt+S1+oJOQptBsYs/sYyYtWEyoDM=; b=k/U4iV/FJ8yy1aoI8KY9wyKys977LDmup9FOx+VDUJlXPvFr32AHb36xJE3nu8jqW4 M/O7MSx02njGAkboELlkPJiuVzDMfhUuoat3Mrl9lor7sAfK14mJ9TfYIEDHn+IsAIov ZcAghcD/y12/Lbqm/hQbL5CLFWOFh2LosnYE5HG5pDwSrqb5LR+MFnTjyh93wErZSFsr v7snGkhQpQHvnZ9b//x2ErXMiMi2V+BGhrglWc2/U7yDB8sw32ndRHbWFpPcglgRNPq6 U4sKyWdpnQxbIx0M8FpvLkWqmC2bVkF7Nq2qWBqDC8Nyhd/CiWfI98mgOffy/ahQPZKD dxCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SGzLeNjN; 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 g22si4130887edf.398.2019.09.18.16.13.15; Wed, 18 Sep 2019 16:13:46 -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=SGzLeNjN; 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 S1729436AbfIRVPP (ORCPT + 99 others); Wed, 18 Sep 2019 17:15:15 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:51302 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725989AbfIRVPP (ORCPT ); Wed, 18 Sep 2019 17:15:15 -0400 Received: by mail-wm1-f66.google.com with SMTP id 7so1779323wme.1; Wed, 18 Sep 2019 14:15: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=I8yXMHibszj2VHQlt+S1+oJOQptBsYs/sYyYtWEyoDM=; b=SGzLeNjN9RtxfKPfFRxKDpttLPdBNIAdVqAUW/6qBoK7Rdwr6hhG3WkSHuNaNkVqUB IZDH/WrUM/EDQE4L6yrkg8G2Tu4rS/55SwYwMv692WLvgMefVjb0rX/pfh2WfTnDNLAA RkhCsRxNnIVJVynwenKWP9c49eWIS2m1N8e4USectIBr6l/QVdvKcGmwpkF9YF7+nVEC DFAzRLs730dJDNuL0TI6DDBc2FvJRxsoiPOop4zcGoU5zTO08ViDqGTwq+3dMt0pPNtc RI1uuxwtGLRv+QZtCK4E4ZsP7l3B8i+jWh3JZJeyKZrY2CcaNCT6wvkkQqfEUq8d56/F UrYQ== 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=I8yXMHibszj2VHQlt+S1+oJOQptBsYs/sYyYtWEyoDM=; b=kjl09KWBnLJmmJrczlgbr7TywRUzEqF8eY4RAnvwREuM59lIMjdxW7gYsEWrcan9OV /ZKGex+9/qCi1KJRd7nzGu8/Q++3ePULcWDf66PdnfBEuts2FHyQUYJ1kL+zwTIzFFUo LYPL5GhBI41AsRY6wDdtEpjao+NW2ZFgwiuJrsfL/Sj2Z9fTeb+tFfEaYtUTSsMrZJVI uVnMe7mZjpfdw4l+Kavm+QTNYP2k6lZxVsnC85eRu4xewi9b3ZX9DQnbBV0vG2Hoc0Yv 8YAYZ6C7W8Em5nzOg5Jj1amUAQyWoqOfh4Nc7RtSq9C99qH5UcueChkPcsoR5A2+LtVL mQAA== X-Gm-Message-State: APjAAAUJiAFCrJ07+YW3HPJjrqaLmo7y7nh3ogu0mPq7bMjBblyXJMzk 36pfB/zMU5KP3Dxy5SHfx+I= X-Received: by 2002:a1c:a6ca:: with SMTP id p193mr4303240wme.103.1568841312486; Wed, 18 Sep 2019 14:15:12 -0700 (PDT) Received: from darwi-home-pc ([5.158.153.52]) by smtp.gmail.com with ESMTPSA id h9sm4969976wrv.30.2019.09.18.14.15.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2019 14:15:11 -0700 (PDT) Date: Wed, 18 Sep 2019 23:15:03 +0200 From: "Ahmed S. Darwish" To: Linus Torvalds Cc: Lennart Poettering , "Theodore Y. Ts'o" , "Eric W. Biederman" , "Alexander E. Patrakov" , Michael Kerrisk , lkml , linux-ext4@vger.kernel.org, linux-man@vger.kernel.org Subject: [PATCH RFC v4 0/1] random: WARN on large getrandom() waits and introduce getrandom2() Message-ID: <20190918211503.GA1808@darwi-home-pc> References: <20190911173624.GI2740@mit.edu> <20190912034421.GA2085@darwi-home-pc> <20190912082530.GA27365@mit.edu> <20190914122500.GA1425@darwi-home-pc> <008f17bc-102b-e762-a17c-e2766d48f515@gmail.com> <20190915052242.GG19710@mit.edu> 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 Hi, This is an RFC, and it obviously needs much more testing beside the "it boots" smoke test I've just did. Interestingly though, on my current system, the triggered WARN() **reliably** makes the system get un-stuck... I know this is a very crude heuristic, but I would personally prefer it to the other proposals that were mentioned in this jumbo thread. If I get an OK from Linus on this, I'll send a polished v5: further real testing, kernel-parameters.txt docs, a new getrandom_wait(7) manpage as referenced in the WARN() message, and extensions to the getrandom(2) manpage for new getrandom2(). The new getrandom2() system call is basically a summary of Linus', Lennart's, and Willy's proposals. Please see the patch #1 commit log, and the "Link:" section inside it, for a rationale. @Lennart, since you obviously represent user-space here, any further notes on the new system call? thanks, Ahmed S. Darwish (1): random: WARN on large getrandom() waits and introduce getrandom2() drivers/char/Kconfig | 60 ++++++++++++++++++++++++-- drivers/char/random.c | 85 ++++++++++++++++++++++++++++++++----- include/uapi/linux/random.h | 20 +++++++-- 3 files changed, 148 insertions(+), 17 deletions(-) -- http://darwish.chasingpointers.com