From patchwork Mon Dec 14 15:14:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 41377 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 06DD438350A8; Mon, 14 Dec 2020 15:15:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 06DD438350A8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1607958912; bh=5cqx+3h7MvG8Xp0Ew7JhZhHiF2bX1083jx+2jQUgFRY=; h=References:In-Reply-To:Date:Subject:To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=alLyrGoxDyS0AIne+7Pa88+ZUgRXe2SryyLP699fqRykxVCCrPNn6BRlsfCQhX5af rDNeFnMY+rM+EfirZOfBtk4Tqropu51UMzE4eNFJ4ZUuQ2Mpd0j2v5OR8sjbf5mjll nyVoQ5rUFOxW/p7jYbkzSbOwS8NFo+Tj46Go5FLg= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-ot1-x32e.google.com (mail-ot1-x32e.google.com [IPv6:2607:f8b0:4864:20::32e]) by sourceware.org (Postfix) with ESMTPS id 705AF3842439 for ; Mon, 14 Dec 2020 15:15:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 705AF3842439 Received: by mail-ot1-x32e.google.com with SMTP id f16so15992796otl.11 for ; Mon, 14 Dec 2020 07:15:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5cqx+3h7MvG8Xp0Ew7JhZhHiF2bX1083jx+2jQUgFRY=; b=M/g6J8lYwMBWqgxeLOjSoHvQF+8cP4pV0EZdgUGc7zdCjfXr8FpeDwPrZpzUgkqvgB wZz8aVzRmZ+jfJK4/3k1dEAaD/J1x9BbR2FcSpchn3NLvVGTSQWBTFd04PpOHWqp+cCD aTQY80K6CdDvk+sQyoh3QG94MN8AGRqkIKTaDe2/Od/iQNJaMtzbCLA5UE27t7PDf7GQ WPfLgxoxBAj0q+8+h0B1jyHUaziL5ARew71V8ieZrSWYk4ZMW6iE+Eqxit9Nsl6o2qQ9 fqgndaxIP8SqXod19KI6EHUcv/wkAyl7qmfI7MwE5x9Q3b/17SCfri0k3SHIfaPJ4D5v yzSQ== X-Gm-Message-State: AOAM531BUKcz5t96DAvrx721YZKUNMlJCMGThaFS3uzoOW8ltrzyNBcK QG6tTC0OY/DiTSJhkJtCrm+KoUIK8YNs5K2YJCCY6+to8/k= X-Google-Smtp-Source: ABdhPJywEEHSRrbKPocsBGSLmCNb2EIpkyQ5FNiCw5hU5mhw8HvGiQGdGb728nD0KPrjmaaIlS/1Owu/pE36CNDIfvY= X-Received: by 2002:a9d:eeb:: with SMTP id 98mr19925525otj.179.1607958908874; Mon, 14 Dec 2020 07:15:08 -0800 (PST) MIME-Version: 1.0 References: <20201213145143.809557-1-hjl.tools@gmail.com> In-Reply-To: Date: Mon, 14 Dec 2020 07:14:32 -0800 Message-ID: Subject: [PATCH] x86: Remove the default REP MOVSB threshold tunable value [BZ #27061] To: "Carlos O'Donell" X-Spam-Status: No, score=-3037.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, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-Patchwork-Original-From: "H.J. Lu via Libc-alpha" From: "H.J. Lu" Reply-To: "H.J. Lu" Cc: GNU C Library Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" On Mon, Dec 14, 2020 at 6:59 AM Carlos O'Donell wrote: > > On 12/13/20 9:51 AM, H.J. Lu via Libc-alpha wrote: > > Since the default REP MOVSB threshold is 2048 * (vector size / 16), > > remove its default tunable value so that the correct default value > > will be set correctly by init_cacheinfo (). > > This is a failure in the tunables framework. We should have internal > APIs to detect: > * Set by user. > * Still set to default. > I've run into this before when we were looking at some of the other > tunables for x86. Please file an enhancement request for this and > then we can look at implementing this and adding back the defaults. https://sourceware.org/bugzilla/show_bug.cgi?id=27069 > OK with the typo fix and upstream bug reference. Fixed. > Reviewed-by: Carlos O'Donell > > > --- > > sysdeps/x86/dl-tunables.list | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/sysdeps/x86/dl-tunables.list b/sysdeps/x86/dl-tunables.list > > index 1a4a93a070..348616fb69 100644 > > --- a/sysdeps/x86/dl-tunables.list > > +++ b/sysdeps/x86/dl-tunables.list > > @@ -39,9 +39,10 @@ glibc { > > # REP MOVSB. Since larger register size can move more data with a > > # single load and store, the threshold is higher with larger register > > # size. Note: Since the REP MOVSB threshold must be greater than 8 > > - # times of vector size, the minium value must be updated at run-time. > > + # times of vector size and the default value is 2048 * (vector size > > + # / 16), the default value and the minium value must be updated at > > s/minium/minimum/g > > Please add references to upstream bug. Fixed. > > + # run-time. > > minval: 1 > > - default: 2048 > > } > > x86_rep_stosb_threshold { > > type: SIZE_T > > > > > -- > Cheers, > Carlos. > Here is the patch I am checking in. Thanks. From 07f5e6c5e2f91854024c6294e436418c504fe66b Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sun, 13 Dec 2020 04:56:41 -0800 Subject: [PATCH] x86: Remove the default REP MOVSB threshold tunable value [BZ #27061] Since we can't tell if the tunable value is set by user or not: https://sourceware.org/bugzilla/show_bug.cgi?id=27069 remove the default REP MOVSB threshold tunable value so that the correct default value will be set correctly by init_cacheinfo (). Reviewed-by: Carlos O'Donell --- sysdeps/x86/dl-tunables.list | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sysdeps/x86/dl-tunables.list b/sysdeps/x86/dl-tunables.list index 1a4a93a070..bc26e9fa01 100644 --- a/sysdeps/x86/dl-tunables.list +++ b/sysdeps/x86/dl-tunables.list @@ -39,9 +39,11 @@ glibc { # REP MOVSB. Since larger register size can move more data with a # single load and store, the threshold is higher with larger register # size. Note: Since the REP MOVSB threshold must be greater than 8 - # times of vector size, the minium value must be updated at run-time. + # times of vector size and the default value is 2048 * (vector size + # / 16), the default value and the minimum value must be updated at + # run-time. NB: Don't set the default value since we can't tell if + # the tunable value is set by user or not [BZ #27069]. minval: 1 - default: 2048 } x86_rep_stosb_threshold { type: SIZE_T -- 2.29.2