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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0BD7C4708E for ; Tue, 3 Jan 2023 20:03:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2DF6D8E0002; Tue, 3 Jan 2023 15:03:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 28FC38E0001; Tue, 3 Jan 2023 15:03:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 130288E0002; Tue, 3 Jan 2023 15:03:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 0394B8E0001 for ; Tue, 3 Jan 2023 15:03:18 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id C52E2AADF2 for ; Tue, 3 Jan 2023 20:03:17 +0000 (UTC) X-FDA: 80314562034.09.29E5EA8 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf19.hostedemail.com (Postfix) with ESMTP id 03C1D1A0017 for ; Tue, 3 Jan 2023 20:03:15 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=zx2c4.com header.s=20210105 header.b=XVatXkuo; dmarc=pass (policy=quarantine) header.from=zx2c4.com; spf=pass (imf19.hostedemail.com: domain of "SRS0=kn2u=5A=zx2c4.com=Jason@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=kn2u=5A=zx2c4.com=Jason@kernel.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1672776196; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ZdGBYtenf9KxXkGsFOfF/k2UzSaOBjlov7xbIEO1hqo=; b=Sbdu4nEC+EOIy4KYnxdl81YJ4Q/rEgfFsGnxZADnfsqsCg0AvdB0hpTPhiOEIV8pvY6/9H 3V1mkdVvzCDHjRyZVDnbQySp+b36U/CwrfR+fFYTmCPIVyeYhZO5wZ4PFx7Xs2dI92wwNy W0+fwfYGtwYNzvOwd29ugTq++XH+OZo= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=zx2c4.com header.s=20210105 header.b=XVatXkuo; dmarc=pass (policy=quarantine) header.from=zx2c4.com; spf=pass (imf19.hostedemail.com: domain of "SRS0=kn2u=5A=zx2c4.com=Jason@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=kn2u=5A=zx2c4.com=Jason@kernel.org" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1672776196; a=rsa-sha256; cv=none; b=tLguMhz6hUHeQr1eDMeW35t8T8pkHyF24JEWJTK7ljQJQXpO28aHb2a6mwjXwp5QBKG3+v FM7zNoaMoxAZZrvgSSPCKwyj4nwpgbjKoidaHlzq/LbJMT+kx1iInQz7PkonQMexvN4ZZd RrlmAb/FDFtG4yBg6i8ZRmPanRn6qzA= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id DE35F614FA; Tue, 3 Jan 2023 20:03:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8FC1AC433EF; Tue, 3 Jan 2023 20:03:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1672776190; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZdGBYtenf9KxXkGsFOfF/k2UzSaOBjlov7xbIEO1hqo=; b=XVatXkuoV0uGA2AaTjRQihENTEl8P/ghrbSfd+C52hahB6oZ3eSLyNshSJamr1HuVuUgO0 8garo777KMimsXexIpTlMxIpPKCNXANL7cp3WG5cMav2S3Ga3r9HKBjmkXVDnSOvXfdnwM QLN9+/SNe7BjC5yoNesisS2nMDH+uiI= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id eb8698a6 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 3 Jan 2023 20:03:10 +0000 (UTC) Date: Tue, 3 Jan 2023 21:03:07 +0100 From: "Jason A. Donenfeld" To: Linus Torvalds Cc: Andy Lutomirski , Ingo Molnar , linux-kernel@vger.kernel.org, patches@lists.linux.dev, tglx@linutronix.de, linux-crypto@vger.kernel.org, linux-api@vger.kernel.org, x86@kernel.org, Greg Kroah-Hartman , Adhemerval Zanella Netto , Carlos O'Donell , Florian Weimer , Arnd Bergmann , Jann Horn , Christian Brauner , linux-mm@kvack.org Subject: Re: [PATCH v14 2/7] mm: add VM_DROPPABLE for designating always lazily freeable mappings Message-ID: References: <20230101162910.710293-1-Jason@zx2c4.com> <20230101162910.710293-3-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 03C1D1A0017 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: b7hhzdyzj6fcei9dhu1qfhwbwei87k1w X-HE-Tag: 1672776195-160813 X-HE-Meta: U2FsdGVkX184q+V267iU1+ajbMvAxYgqBPPpJJxqphbRY1znbbpFCip4WeNG5KcoOPhpLLaZTE2ARFoiumoGPz9b15fBGRTUV+HgDWYorIFKDCjI+AiKk9MKIVWIAJW72PkGmF9JUJ1aDDN1eg05PD1H36gtBh+Y9op79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bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi Linus, On Tue, Jan 03, 2023 at 11:54:35AM -0800, Linus Torvalds wrote: > So 99% of the time, the solution really is just "getrandom()", > generally with the usual buffering ("read more than you need, so that > you don't do it all the time").\ That buffering cannot be done safely currently -- VM forks, reseeding semantics, and so forth. Again, discussed in the cover letter of the patch if you'd like to engage with those ideas. > just using your own rng in user space entirely. This is the thing that isn't quite safe. > Let me guess: the people you talked to who were excited about this are > mainly just library people? No, actually. Mainly people deploying production network-facing things that need a lot of randomness often. e.g. CBC nonces in TLS, or random sequence numbers in UDP-based protocols. > So when you say that this isn't about micro-optimizations, I really > say "humbug". It's *clearly* about micro-optimization of an area that > very few people care about, since the alternative is just our existing > "getrandom()" that is not at all horribly slow. The alternative is what people currently do, which is attempt to implement a userspace RNG, which cannot be done safely. Again, --> cover letter. > Because the people who actually *use* the random numbers and are *so* > performance-critical about them already have their own per-thread > buffers or what-not ...which are not safe. Anyway, if you're NACK'ing the whole getrandom() vDSO project, just please outright say so, so I don't spend another 14 revisions in vain. Jason