From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x2b.google.com (mail-oa1-x2b.google.com [IPv6:2001:4860:4864:20::2b]) by sourceware.org (Postfix) with ESMTPS id 0CA603887F59 for ; Mon, 5 Jun 2023 17:46:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0CA603887F59 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-oa1-x2b.google.com with SMTP id 586e51a60fabf-19f6f8c8283so5451398fac.3 for ; Mon, 05 Jun 2023 10:46:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685987182; x=1688579182; 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=g8eef5ESyKcWgROXmtGlulLqrAY60niWQF6SRG/uMAI=; b=MYdcga4hVbXTYNAkApIKpfX/hV07P3cHIXQ3teMAqmn6gXRlKxi9EmaHF+JY9RlkaO 4Dfq3++WYPo0BXZndpHWlzClr8kqAOzvIErw0bg5C8EwLgSqOR4aUYea0UwDZKho40So xc4E6JnX53DgsVsPq5hmCMwbidoNCzKxJY0up9h2llBO6fo2i6OKvMQKXAl8Gy7+BS3H cFQJzckaA+Jz4PsxrWZnxrXPRHBrOe5V5CEaHINlIcGgsukoawkBDjr+Gzfmdb9SuYNt 3Q9kIJSB0hs0O8l5rhcl0eJ0c1Og8d2MJ1GCmch5KtQv5E6Et2GWGE0Na3dEUS7+2/DX wNNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685987182; x=1688579182; 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=g8eef5ESyKcWgROXmtGlulLqrAY60niWQF6SRG/uMAI=; b=JwJ1gz58HMjKdREyGihVieep6YFfDECTGGiIqr0LK1eilamnnFiR8zvfNB/prp7KL5 neobH76VEm9MC+qnbU3PUNf8iChkWv9+thw9W758Xe4c8Es0xSCgwmVKkZGV96VurxMS 29QHauFmIC7s4AQbqh7GOV+LFxW5v0iniYjOcrZ4BVkDgn/q9zSyIomTgngosHDqJv2F KEZVcIpYUn9D9Zlss3FDh1FFEO0n+iB/EITbtDjtUYg+721hG5PExmmI20idVesOFtD+ 2pBS9Dpf33MS3mIBc0soaq7ZWfc7uE5HcmJ+jEiD1QG5nvXiQpPOWKvqtgO56A7UVWf7 b7FA== X-Gm-Message-State: AC+VfDx0sxSx8nuznRx/zCMsBl1c7fqj6Zw55kHUX9TvdDJQeKkQ+7rn jiWX+KL/qN0TGwUrJIMnr1N/NHCBKDGo8jXO+XToEWzF X-Google-Smtp-Source: ACHHUZ6J/XdUg6ebYEBQY0LoL6A5B962Bqr6HBBo4BAM5WCuLZElpae4Bdicre9CMV4LxsYoexPVfLJxQBQ8DouwJ6A= X-Received: by 2002:a05:6870:1983:b0:1a3:74e:7863 with SMTP id v3-20020a056870198300b001a3074e7863mr401644oam.4.1685987182338; Mon, 05 Jun 2023 10:46:22 -0700 (PDT) MIME-Version: 1.0 References: <20230509031020.3496291-1-goldstein.w.n@gmail.com> In-Reply-To: From: "H.J. Lu" Date: Mon, 5 Jun 2023 10:45:46 -0700 Message-ID: Subject: Re: [PATCH v1] x86: Use 64MB as nt-store threshold if no cacheinfo [BZ #30429] To: Noah Goldstein Cc: libc-alpha@sourceware.org, carlos@systemhalted.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3021.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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 Mon, Jun 5, 2023 at 10:15=E2=80=AFAM Noah Goldstein wrote: > > On Mon, May 8, 2023 at 10:10=E2=80=AFPM Noah Goldstein wrote: > > > > If `non_temporal_threshold` is below `minimum_non_temporal_threshold`, > > it almost certainly means we failed to read the systems cache info. > > > > In this case, rather than defaulting the minimum correct value, we > > should default to a value that gets at least reasonable > > performance. 64MB is chosen conservatively to be at the very high > > end. This should never cause non-temporal stores when, if we had read > > cache info, we wouldn't have otherwise. > > --- > > sysdeps/x86/dl-cacheinfo.h | 10 +++++++++- > > 1 file changed, 9 insertions(+), 1 deletion(-) > > > > diff --git a/sysdeps/x86/dl-cacheinfo.h b/sysdeps/x86/dl-cacheinfo.h > > index 864b00a521..6225c852f6 100644 > > --- a/sysdeps/x86/dl-cacheinfo.h > > +++ b/sysdeps/x86/dl-cacheinfo.h > > @@ -771,8 +771,16 @@ dl_init_cacheinfo (struct cpu_features *cpu_featur= es) > > reflected in the manual. */ > > unsigned long int maximum_non_temporal_threshold =3D SIZE_MAX >> 4; > > unsigned long int minimum_non_temporal_threshold =3D 0x4040; > > + > > + /* If `non_temporal_threshold` less than `minimum_non_temporal_thres= hold` > > + it most likely means we failed to detect the cache info. We don't= want > > + to default to `minimum_non_temporal_threshold` as such a small va= lue, > > + while correct, has bad performance. We default to 64MB as reasona= ble > > + default bound. 64MB is likely conservative in that most/all syste= ms would > > + choose a lower value so it should never forcing non-temporal stor= es when > > + they otherwise wouldn't be used. */ > > if (non_temporal_threshold < minimum_non_temporal_threshold) > > - non_temporal_threshold =3D minimum_non_temporal_threshold; > > + non_temporal_threshold =3D 64 * 1024 * 1024; > > else if (non_temporal_threshold > maximum_non_temporal_threshold) > > non_temporal_threshold =3D maximum_non_temporal_threshold; > > > > -- > > 2.34.1 > > > > I want to backport down to 2.28. > Thoughts? Who will use such backport? --=20 H.J.