From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 069963858D1E for ; Thu, 21 Mar 2024 07:39:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 069963858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 069963858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711006773; cv=none; b=G33YuZd7cBVudeYzqz7eNkHZ6yiTiAYiY8mOJXhRCvZG9MoiQZkZguDDIwZu4y3bA/vJ4M9mAoRSnMYVoR5F52D12iV2CmMI95555O1k1P7Q0mu69IVDY4dzy9VWMH3tu3tHexn3fm28+Va7ny6apYEFm4w+Ij+42XsOTawKC0A= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711006773; c=relaxed/simple; bh=99CJl/JrTAB/FprkW3SZhD9aIXJ4djaVMJtv/EMVu4I=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Jnu9RFrB6tCmnOlLopj1vuduoXgKhU5wGLw9oRfsO0nn9vb3TeL52R3QL8OYjiGoICKN57C3IiuKY4fSOei9wBcuHfxTD1nT21qS0yoOJaUWvxo2f9l+jEr0Uh23AYPQx4yyynvy8BqsIMP1+v724O6oZlnJj+vAEYOXjAzZAVg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711006770; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vVKtcHOAZQDxoAeFgXp608DL6r3bFhLMSk+jrVSpBZ0=; b=DsJsAd2KLQ58LLU/aaf6NPcLY5c/gBbp9DdY8sclYuVHwqqDaVSrvmbI0jXJpASAVZIpDb NWQWBfZ/covhO8OYBCZTET8uTTSBc5beDhTokj5WwEBOp6mVmts9aDvJdFWWEMmRqXy9rY IyFUEN1b58hHqK2HegYUB51bD0aNgMA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-411-KLWSEe_9Orqevpza82Nd1Q-1; Thu, 21 Mar 2024 03:39:29 -0400 X-MC-Unique: KLWSEe_9Orqevpza82Nd1Q-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C004A800264; Thu, 21 Mar 2024 07:39:28 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.83]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 835038173; Thu, 21 Mar 2024 07:39:27 +0000 (UTC) From: Florian Weimer To: Adhemerval Zanella Netto Cc: Cristian =?utf-8?Q?Rodr=C3=ADguez?= , Wilco Dijkstra , GNU C Library Subject: Re: [PATCH 2/2] Add single-threaded fast path to rand() References: <89b53f94-075f-4a34-99df-778271965de9@linaro.org> Date: Thu, 21 Mar 2024 08:39:21 +0100 In-Reply-To: (Adhemerval Zanella Netto's message of "Wed, 20 Mar 2024 11:27:25 -0300") Message-ID: <878r2c11au.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * Adhemerval Zanella Netto: > On 20/03/24 11:18, Cristian Rodr=C3=ADguez wrote: >> On Wed, Mar 20, 2024 at 9:31=E2=80=AFAM Adhemerval Zanella Netto >> wrote: >>=20 >>=20 >>> I don't have a strong opinion on this rand patch, if this idea is to >>> have it as an workbench for a possible single-thread lock optimization >>> it should be fine. It is just that I don't see much gain in optimizing >>> such a bad interface (although we still lack a proper userland PRNG). >>=20 >> Yeah, it should be no surprise this interfaces are bad, >> I thought this was common knowledge. >>=20 >> we need something like https://github.com/C2SP/C2SP/blob/main/chacha8ran= d.md >> which prety much outperforms even non-CS algorithms in at least 64 bit x= 86. >> but the question of the state remains.global? TLS? how to discard it >> in all the appropriate occasions? > > And this is the arc4random in userspace discussion all over again. Agreed. But what has changed that we know now that Linux won't provide us with vDSO acceleration for arc4random. So I think it wouldn't be unreasonable to roll our own. Right now, the switch to arc4random provided by glibc is a massive performance regression compared to other implementations. Thanks, Florian