From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x32.google.com (mail-oa1-x32.google.com [IPv6:2001:4860:4864:20::32]) by sourceware.org (Postfix) with ESMTPS id 0E0D43858CDA; Wed, 5 Oct 2022 16:36:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0E0D43858CDA 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-x32.google.com with SMTP id 586e51a60fabf-132555b7121so11505681fac.2; Wed, 05 Oct 2022 09:36:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=uw5OX/Axcqfnf/XC/8vmXucbF7SSaO4lh9DZk3KicAM=; b=Vovxb+0aMHRJUDKykyfxz4UI5fhDETNfXvttpI7mXZ9sZI0eaHpP7J+3TVpK0inAX6 jk953+himicDwPhu4CTBDCN04yelkkRnmJm4DrYmFQI7VoEXeCBOmTWvHyxkQ2JtGKFu ui2wBljubQDYjg8SvoywkVhg9xwI3xLiuws+KDWpVdVPu7JncUi0ZiBkjZlwV9o+0VcN AtBFOVClYhOSShPO5EhE5lZobBGxGxr67eBkZFYrwQG51L60L+WeacLVNXG5PYHlYkZt 7SzCAH3VHgvkjV7q1dtyocteW5tNg52ipm2cWMbK5vGBJdem5vXzUkHjcSLXeIs8aVS3 ALQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=uw5OX/Axcqfnf/XC/8vmXucbF7SSaO4lh9DZk3KicAM=; b=FegI6azwi18tBhJXeWzUFkLxky8UH1Ki6+zrQjpGTW0CgC+prT9yqj6/ZXzhM+VVo5 eqMDMGCYaTe8Bugv7/g5pJleqBuxpsusMpdoHQ5zewAQncOln0WekeUPRGiadwSRviUB lt5lTaJwz683wIZRB908tnfjpJ1cU2UB3BTe/RNZnsD1WozqraXlqb7oQ+sqSnsyGb+j hzRuWwz+oUmWcCQvqFdx7lPD43D90Sbm2zlSdb+mJfrvoIVXQP+GtSUhv4O10zIxyioF Jpukc9ZyQXcHTdHBVarWsbcdzMMFww+KMo3IW1k2BOPXId0Tl6FSRSfo83PykilERhLk 1VSQ== X-Gm-Message-State: ACrzQf3pOFulBd70P2Ouj5GPhyRycDRDCddewVvUGuqo8p/C/VgfRY6J JKVojy1I0DwWd2QotlaSWxAPJgAcG+rkc1fuc5E= X-Google-Smtp-Source: AMsMyM7aPlHJJUKW8J0RsQmtSYCXSgTHN/1WZQqUHjUtfhFhn9YhMxP5EN19MXVrGcvEbhPmgpPCRJGZ/KZFhHMpkk4= X-Received: by 2002:a05:6870:d1d0:b0:12c:cfd2:8285 with SMTP id b16-20020a056870d1d000b0012ccfd28285mr238567oac.105.1664987787565; Wed, 05 Oct 2022 09:36:27 -0700 (PDT) MIME-Version: 1.0 References: <20210419233607.916848-1-goldstein.w.n@gmail.com> <20210419233607.916848-2-goldstein.w.n@gmail.com> In-Reply-To: From: Sunil Pandey Date: Wed, 5 Oct 2022 09:35:51 -0700 Message-ID: Subject: Re: [PATCH v5 2/2] x86: Optimize strlen-avx2.S To: Noah Goldstein Cc: Libc-stable Mailing List , Hongjiu Lu , GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HK_RANDOM_ENVFROM,HK_RANDOM_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no 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 Wed, Oct 5, 2022 at 7:23 AM Noah Goldstein wrote: > > On Tue, Oct 4, 2022 at 6:11 PM Sunil Pandey wrote: > > > > On Tue, Oct 4, 2022 at 2:20 PM Aurelien Jarno wrote: > > > > > > On 2022-09-28 06:54, Sunil Pandey via Libc-stable wrote: > > > > Attached patch fixes BZ# 29611. > > > > > > > > I would like to backport it to 2.32,2.31,2.30,2.29 and 2.29. Let me know > > > > if there is any objection. > > > > > > Sorry to be late on this. I have a few comments about that patch: > > > > > > > From 86e1d88e1a3c126597ef39165275ada7564cfce9 Mon Sep 17 00:00:00 2001 > > > > From: "H.J. Lu" > > > > Date: Mon, 19 Apr 2021 10:45:07 -0700 > > > > Subject: [PATCH] x86-64: Require BMI2 for strchr-avx2.S > > > > > > > > Since strchr-avx2.S updated by > > > > > > > > commit 1f745ecc2109890886b161d4791e1406fdfc29b8 > > > > Author: noah > > > > Date: Wed Feb 3 00:38:59 2021 -0500 > > > > > > > > x86-64: Refactor and improve performance of strchr-avx2.S > > > > > > > > uses sarx: > > > > > > > > c4 e2 72 f7 c0 sarx %ecx,%eax,%eax > > > > > > > > for strchr-avx2 family functions, require BMI2 in ifunc-impl-list.c and > > > > ifunc-avx2.h. > > > > > > > > (cherry picked from commit 83c5b368226c34a2f0a5287df40fc290b2b34359) > > > > --- > > > > sysdeps/x86_64/multiarch/ifunc-avx2.h | 4 ++-- > > > > sysdeps/x86_64/multiarch/ifunc-impl-list.c | 12 +++++++++--- > > > > 2 files changed, 11 insertions(+), 5 deletions(-) > > > > > > First of all 1f745ecc2109890886b161d4791e1406fdfc29b8 never got > > > backported to 2.32 and older branches, and strchr-avx2.S in those > > > branches do not use BMI2 instructions. So it doesn't make sense to > > > backport it. > > > > > > That said the change in ifunc-avx2.h fixes: > > > > > > - memchr and rawmemchr, broken by the backport of acfd088a1963 ("x86: > > > Optimize memchr-avx2.S") > > > - strlen and strnlen, broken by the backport of aaa23c350715 ("x86: > > > Optimize strlen-avx2.S") > > > > > > So the issues are fixed, but mostly by chance. > > > > How do you know it is a "by chance" fix, do you have any evidence to back > > your claim? > > There might not be evidence about the intention of the authors but clearly > the strchr commit message does not clarify that it also fixes memchr/strlen. ifunc-avx2.h header file is used in many functions, so fix in ifunc-avx2.h fixes all those functions too. It's not "by chance", I scan all the functions where ifunc-avx2.h are used before backporting it. Since this is a backport commit and no extra changes are made, there is no need to modify the original author commit message. > > > > > > > > NB: at this stage, I haven't verified the consistency of the ifunc > > > selectors with ifunc-impl-list.c. > > > > > > -- > > > Aurelien Jarno GPG: 4096R/1DDD8C9B > > > aurelien@aurel32.net http://www.aurel32.net