From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by sourceware.org (Postfix) with ESMTPS id 106163858D1E for ; Fri, 24 Mar 2023 16:30:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 106163858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-x531.google.com with SMTP id ew6so10105337edb.7 for ; Fri, 24 Mar 2023 09:30:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679675402; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=S1savKHPjCWuKke3k9eHYRBc3pYg3lN4PHNzRKzsMBE=; b=Ouic9WwhuU5KQwKeKTvACapjs3tPsIB5omrMYFVxsMXpvjooY1+Mo7uY+IQZi2WOas JYfVU+Balpk4J2GeGWWWqCJkw2hBmU2QwUI5CU9S03vSxP4MVe+N1S5FuDvxGfHlRPlC ZEuXXBozl53MjdRZfoRSMiQFxdGMbpeUrMMIfrRIPPKn0djJz5ELwhFrM9d71lBcMEah 66W5kIpDolCqNDfwkW7qcXkEXmo2sn5AHojwSl0810kEgEpAiKojPp5saAYos26PXtAB q5YjFHKr4RAhNPjji25ycg2RtQ739oa9OQsAp+YZNeySHVztnDqNK7pGaZtzi+SVeq89 /zfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679675402; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=S1savKHPjCWuKke3k9eHYRBc3pYg3lN4PHNzRKzsMBE=; b=WnOsIiyAjzX9jEgHDDr+M5uQ1241WMVfeiUiOApFEXf025tx6267cGCfzcaDq28NLC ektosPTwkoAMAiC4XIkECCbufZFfNEmTJI56m1XRc8BzXlV8r1ehlKFnMIOJ2fLxczlL 2NlzfUp32AwQMuvu33TMqcWpHnO1ohpjjX9HhIeBjx8aqQerbwkb7ezIUHc8rTHVUzrf oWp4MdslnnOFrLsqyvj6rYBZZSSlrkc0mT7U3tPxoW4lUzPW+Ggtqhw0GSPqGlnh0zOD Pq4k2eHeJUy7yiPYe/FCYywv3d4tyWUrYFTN7IalRCxdlKiotoy3OzVsDqgIGuZg23F+ xDHA== X-Gm-Message-State: AAQBX9dt04E2P2Ace/0jOE8B+8xC9oGuGkTGk2OK/RMmWe3i7Fau1cQs I28hmyPTSgPXVoYzZbTqlpooppSuTvE1+r+vt/NNoLEMc4Q= X-Google-Smtp-Source: AKy350YD5M7oTyh/McBSXJaWFRFFoFJM43ICyG14+yt8qoNmWEpOmcOjUN8WjkmyhlftM02V0NmU68oM2wb/BqFWsLA= X-Received: by 2002:a17:907:6e22:b0:932:e546:b8bb with SMTP id sd34-20020a1709076e2200b00932e546b8bbmr1819313ejc.0.1679675401645; Fri, 24 Mar 2023 09:30:01 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Noah Goldstein Date: Fri, 24 Mar 2023 11:29:50 -0500 Message-ID: Subject: Re: [PATCH] Benchtests: Improve large memcpy/memset benchmarks To: Wilco Dijkstra Cc: GNU C Library Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3.5 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 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: On Thu, Mar 23, 2023 at 6:01=E2=80=AFPM Wilco Dijkstra wrote: > > Hi Noah, > > > >> - align &=3D 63; > > > > Can you replace with `align &=3D getpagesize () - 1`? > > Yes that would make more sense indeed. > > >> - if ((align + len) * sizeof (CHAR) > page_size) > >> - return; > > > > Is there a reason to remove the out of bounds check? > > Well it can't ever go out of bounds. The allocated buffer size is > 2 * page_size (ie. 4 times real page size or 2 times MIN_PAGE_SIZE > due to the incorrect logic in init_sizes). > I disagree, we have a bounds check in nearly all other benchmarks and I think its 1) a convenience so you don't need to add the equivalent code in many other places and 2) a portability thing as page size varies by system but people often write benchmark bounds with constant size bounds. > And if it could go out of bounds it should be an assert so we don't > silently benchmark a bounds check! Then I think the approach would be to output the json parameters and report invalid in some way for the times. In other places benchmarks rely on this bounds check and it seems more error prone than anything else to just leave it unchecked. I would much rather the benchmark not run or fail in some way than report a potentially incorrect time as true. > > >> align2 &=3D 4095; > > > > Might as well fix these up, can you replace 4095 with `getpagesize () -= 1`? > > Sure. > > >> + size_t i, iters =3D (MIN_PAGE_SIZE * 64) / n; > > > > this takes [.5, 10] seconds? > > Yes, it's only 1 GB written per test. It takes ~8.5 seconds on an old slo= w > Cortex-A72. > > Cheers, > Wilco > >