From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x29.google.com (mail-oa1-x29.google.com [IPv6:2001:4860:4864:20::29]) by sourceware.org (Postfix) with ESMTPS id 245F23857418 for ; Thu, 14 Apr 2022 19:48:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 245F23857418 Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-ddfa38f1c1so6286269fac.11 for ; Thu, 14 Apr 2022 12:48:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=6KX5lGXW7qWdw88u2Mk73/OwoGgdWJlfw2FYqUH+d+k=; b=DgYtNDTSi74sZQUOKhyu644a9pXyHz448kFx8XoB1IzAIiHpV6hBz4Wb0jm8DlPASu gud39tPYAANCcVjzy74n6xES0zTxQFXox0+vkQP4nUVi4TrTy8m6JS6W9CGMqH3Wi1gV 5Lx2vMdjz2NiUuy/dp0/Ja+H6uE6TZ/lOs4UQNlMPSqWcDq6uFwFdn7Z8/UcAIL2IFpp /8J+8dK7Y174DoEasu/ewXYMWlDxrDR7hsQfyJmNTrGxnQ1k5I/2o0ctqdxfcjEk4Ioi SQC2TdU4/CRRXM7pHGfLcTvjt0OW/FN9YKsv5PlekMG//2p8S+JzHHXIj6HcHV1EQKXQ rqpA== X-Gm-Message-State: AOAM533LDhFcS4AVQIWjJYCSWPQyiFd2Ba2+bjEwDYEEEEdAWTJosvWV UzXFcoNP2NXzi3qjGwIl/+AcxoVRfTuKDg== X-Google-Smtp-Source: ABdhPJxVy/1ug6A1btpj/qt+v4NSFUY4N02beLMq2pTKLzFhwRHOJwOpkpMZ50YbHGU1V3bEx788+A== X-Received: by 2002:a05:6870:61c8:b0:e1:a94d:d5da with SMTP id b8-20020a05687061c800b000e1a94dd5damr69052oah.271.1649965695488; Thu, 14 Apr 2022 12:48:15 -0700 (PDT) Received: from ?IPV6:2804:431:c7ca:431f:3dc9:7133:8dac:5273? ([2804:431:c7ca:431f:3dc9:7133:8dac:5273]) by smtp.gmail.com with ESMTPSA id lw19-20020a0568708e1300b000e2f7602666sm990276oab.15.2022.04.14.12.48.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Apr 2022 12:48:14 -0700 (PDT) Message-ID: <67f61b55-2448-6fb6-22c6-8937b8e80d99@linaro.org> Date: Thu, 14 Apr 2022 16:48:12 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH 3/7] benchtests: Add arc4random benchtest Content-Language: en-US To: Noah Goldstein Cc: GNU C Library References: <20220413202401.408267-1-adhemerval.zanella@linaro.org> <20220413202401.408267-4-adhemerval.zanella@linaro.org> From: Adhemerval Zanella In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Apr 2022 19:48:17 -0000 On 14/04/2022 16:17, Noah Goldstein wrote: > On Wed, Apr 13, 2022 at 3:26 PM Adhemerval Zanella via Libc-alpha > wrote: >> >> It shows both throughput (total bytes obtained in the test duration) >> and latecy for both arc4random and arc4random_buf with different >> sizes. >> >> + >> +static void * >> +thr_arc4random_latency (void *closure) >> +{ >> + struct thr_arc4random_arg *arg = closure; >> + arg->ret = arg->val == 0 ? bench_arc4random_latency () >> + : bench_arc4random_buf_latency (arg->val); >> + return NULL; >> +} > > I think the expectation is that the chacha calls will be cold, > maybe it is worth adding a cache flush of sorts between > calls. It may be some prefetching in the start will help the code in > that case but would only be a regression with the hot in L1 > benchmarks. > > Can wait though this V1 looks fine. In fact I think just checking the call within a thread does not add much, specially since we don't have any single-thread lock optimization for internal locks. I will remove it on v2 and maybe revise it in the future.