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 X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9D8C3C4CEC4 for ; Wed, 18 Sep 2019 21:15:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6F3C720578 for ; Wed, 18 Sep 2019 21:15:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SGzLeNjN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730334AbfIRVPP (ORCPT ); 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-Google-Smtp-Source: APXvYqywwDo5aqNswzW3Y+s7Aj3EfSnOPHWA+ei2ygDDXyzBDQhbgvA7X5b1d5z5qMXcJPQY2T5TaA== 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 Archived-At: List-Archive: List-Post: 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