From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x235.google.com (mail-oi1-x235.google.com [IPv6:2607:f8b0:4864:20::235]) by sourceware.org (Postfix) with ESMTPS id 74EC43858C53 for ; Thu, 14 Apr 2022 20:48:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 74EC43858C53 Received: by mail-oi1-x235.google.com with SMTP id z8so6694705oix.3 for ; Thu, 14 Apr 2022 13:48:25 -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=qi1hHEmAsW4aDXJdEtVHdk7qEOkdeBs138ybTL2fAvo=; b=0ddVytMdGlolVQBzARkvrIQJ4LnJAJ1GxMu4Si43JOMt1eK0Gw9iQyyJkV1L4BQZV+ Dh9MCGEMLDqbTG1F3GWX9wzO7ZCceyxuPP4SfnDNsMc7ZoJe86juUEfNeKJx9cphc3o7 PpmJFV3eUaVbpThFUwjAeJ56ckr0fMDgAR5Ln82eqAV6f543jydU4K2AWgYLhA4LbWDK G6RoCB2z7htc5w04KKKkRZgju6iZOoZilFGJcSTmXoCLIYjOU/xNMDBpW7zCADjYTy5j 7u+5z0gofJ68rk3tzGaiamolBEh9nB6u80bg2nsykddGVdNr6dKXQUG1fwrxg7msowVE IQTA== X-Gm-Message-State: AOAM5307fLj4G89FfCchbxfpHeFuVdJwcAaozAPFH/54dGOiCfmj/YlC 4Ywdl9GZ57N6+XCyQXCij8JHuw== X-Google-Smtp-Source: ABdhPJxWFBx8BxfmbgvXBDJhSvQ+AER6gWlEGmsMi3ZJX6kUSPdeHBWHxlAwpS/NJOPpxOzhx74/4w== X-Received: by 2002:a05:6808:21a3:b0:2f9:a87d:53a6 with SMTP id be35-20020a05680821a300b002f9a87d53a6mr191098oib.85.1649969304648; Thu, 14 Apr 2022 13:48:24 -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 m187-20020aca58c4000000b002ef721352easm452008oib.14.2022.04.14.13.48.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Apr 2022 13:48:24 -0700 (PDT) Message-ID: <7615119e-079a-32a8-f310-b08830b8a4aa@linaro.org> Date: Thu, 14 Apr 2022 17:48:22 -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> <67f61b55-2448-6fb6-22c6-8937b8e80d99@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 20:48:28 -0000 On 14/04/2022 17:33, Noah Goldstein wrote: > 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? Not take the lock if process is single-threaded, as we do on some fast-path in malloc code.