From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x1129.google.com (mail-yw1-x1129.google.com [IPv6:2607:f8b0:4864:20::1129]) by sourceware.org (Postfix) with ESMTPS id 3BEB23858C53 for ; Thu, 14 Apr 2022 20:33:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3BEB23858C53 Received: by mail-yw1-x1129.google.com with SMTP id 00721157ae682-2ec04a2ebadso66957827b3.12 for ; Thu, 14 Apr 2022 13:33: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:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+6ZkvFhOFlVjFCKGUJ9svx8tGgF90LKl/2gD3D3nIJ8=; b=yvql4LnEcAiTWaf0drfdLKeTft7mGX+0VdEsyhxhAVJcl4nbkQPlEWYGJ4+M98P8+V YtGwwh4ALkWo0NgAkbTQblZFqTdSVL9Nx/7HxNqinxhKqN+YRuQ64iBvMuHrJlllBlIE puCq6O1sL1RA64NJoUUJtkPK5mQWVOckwkWxVrBs23goibtREHxYUIk8//RfMhGhXSB8 wNis65hveHi0VkR9kbXSgvEMYIP50vmHyvzlGHnB3xwiQNi2ShZ9IR35B9+xfPoNO+op 9BuYEQJoCYCgdjq5QUWSWCE1CoIPPx4eXf5L5jMobnBt24D1Lcrj7qDlygja7lyw0M+A lX1g== X-Gm-Message-State: AOAM532VNtCeUcNpmACYQgdhBGR0aVkqoa7GIU82dBpFuwKhvVIQQ3z6 4ZWHObNVtXAhQS/DVlK0eYpkah8Dgf+RncCttr4= X-Google-Smtp-Source: ABdhPJzuxZnZl12EafRA31Qe/ux925Y6vnQltSkB9DxluTLHHyYizGCwmkQ5YQ532p4Jv/8+vul44zQ8U8aOXn+p6IQ= X-Received: by 2002:a81:c44b:0:b0:2d6:4726:ef4b with SMTP id s11-20020a81c44b000000b002d64726ef4bmr3450534ywj.184.1649968395614; Thu, 14 Apr 2022 13:33:15 -0700 (PDT) MIME-Version: 1.0 References: <20220413202401.408267-1-adhemerval.zanella@linaro.org> <20220413202401.408267-4-adhemerval.zanella@linaro.org> <67f61b55-2448-6fb6-22c6-8937b8e80d99@linaro.org> In-Reply-To: <67f61b55-2448-6fb6-22c6-8937b8e80d99@linaro.org> From: Noah Goldstein Date: Thu, 14 Apr 2022 15:33:05 -0500 Message-ID: Subject: Re: [PATCH 3/7] benchtests: Add arc4random benchtest To: Adhemerval Zanella Cc: GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, 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 20:33:17 -0000 On Thu, Apr 14, 2022 at 2:48 PM Adhemerval Zanella wrote: > > > > 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. What do you mean single-thread lock optimization?