From owner-dev-commits-src-main@freebsd.org Mon Feb 8 23:19:04 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C846254584A for ; Mon, 8 Feb 2021 23:19:04 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZMRD59dSz3JsG for ; Mon, 8 Feb 2021 23:19:04 +0000 (UTC) (envelope-from jrtc27@jrtc27.com) Received: by mail-wr1-f51.google.com with SMTP id v14so3658581wro.7 for ; Mon, 08 Feb 2021 15:19:04 -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:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=ukQ64b8MTKDw1x7zWPz9+p4w6kqOeiUPI+Zs45bMWxM=; b=TeR2/sN2+O7XbQ7mzDJ43Mcv7rENTUXicOGpEiBjFy/TduWcI9h4K/CBvhEmOSE/KM OihG1UjkXRANvmlkrq5kqyidf/leStzqvGd5pQbl8x95hDT7aPzddh3DLWshtPf+pIOF FEHQ35swwzhekzyr7DiSaxkVRNJ3q8hVeSZ91mqZZBDT+m88MSyYL9SDF7UxWwIif9XL TA7tWO9cxEq2EFBnWMSdJhtDbe5kT3Zxu4IpU+FZ4tUH7Kcr1tPqoo/FPEIWN0TF34j5 8u3pnJL4kF+CLxGj8u5bGyt6taBrqyEF47Xf9BS9W8nOdqb+ssJvVag8g70PzyiJjatH Kj2A== X-Gm-Message-State: AOAM5300hu+CN5Jzz1BLV9yxjirnBORhiLWK1mVQ2jP3nAmGcaKYjRvY I8wLa3tL4KFujiSghID1mYOPMg== X-Google-Smtp-Source: ABdhPJzuKfwgKh30/uBLXn6vwhl5kM168Z6VP7Z7mSSBDz1jQ52A7YM7ipYS/dBKPkKMgDfP7BleLQ== X-Received: by 2002:adf:fd52:: with SMTP id h18mr22504848wrs.295.1612826343105; Mon, 08 Feb 2021 15:19:03 -0800 (PST) Received: from [192.168.149.251] (trinity-students-nat.trin.cam.ac.uk. [131.111.193.104]) by smtp.gmail.com with ESMTPSA id z15sm1057464wmi.38.2021.02.08.15.19.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Feb 2021 15:19:02 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: git: af366d353b84 - main - amd64: implement strlen in assembly From: Jessica Clarke In-Reply-To: Date: Mon, 8 Feb 2021 23:19:01 +0000 Cc: Mateusz Guzik , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <8E61EA5C-39D1-49CC-8319-06E9192FF735@freebsd.org> References: <202102081915.118JFXkJ067892@gitrepo.freebsd.org> <3E64387A-42DD-4470-8893-5B774F19754E@freebsd.org> To: Kevin Bowling X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4DZMRD59dSz3JsG X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 23:19:04 -0000 > On 8 Feb 2021, at 23:13, Kevin Bowling = wrote: >=20 > FreeBSD does not require pre-commit approval unless called out > specifically. Are you volunteering to review the changes, and if so > where is your guidance? These messages are otherwise unhelpful. It is not a hard requirement, but it is strongly encouraged. Section 7 of the committer's guide says: =E2=80=A2 All non-trivial changes should be reviewed before they = are committed to the repository. This was a non-trivial change. I was particularly frustrated to see this commit go in without review having previously called out mjg@ for not getting any reviews for his (now reverted) previous strlen change. Jess > On Mon, Feb 8, 2021 at 12:37 PM Jessica Clarke = wrote: >>=20 >> On 8 Feb 2021, at 19:15, Mateusz Guzik wrote: >>>=20 >>> The branch main has been updated by mjg: >>>=20 >>> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Daf366d353b84bdc4e730f0fc563853ab= c338271c >>>=20 >>> commit af366d353b84bdc4e730f0fc563853abc338271c >>> Author: Mateusz Guzik >>> AuthorDate: 2021-02-08 17:01:48 +0000 >>> Commit: Mateusz Guzik >>> CommitDate: 2021-02-08 19:15:21 +0000 >>>=20 >>> amd64: implement strlen in assembly >>>=20 >>> The C variant in libkern performs excessive branching to find the >>> non-zero byte instead of using the bsfq instruction. The same code >>> patched to use it is still slower than the routine implemented = here >>> as the compiler keeps neglecting to perform certain optimizations >>> (like using leaq). >>>=20 >>> On top of that the routine can is a starting point for copyinstr >>> which operates on words instead of bytes. >>>=20 >>> Tested with glibc test suite. >>>=20 >>> Sample results (calls/s): >>>=20 >>> Haswell: >>> $(perl -e "print 'A' x 3"): >>> stock: 211198039 >>> patched:338626619 >>> asm: 465609618 >>>=20 >>> $(perl -e "print 'A' x 100"): >>> stock: 83151997 >>> patched: 98285919 >>> asm: 120719888 >>>=20 >>> AMD EPYC 7R32: >>> $(perl -e "print 'A' x 3"): >>> stock: 282523617 >>> asm: 491498172 >>>=20 >>> $(perl -e "print 'A' x 100"): >>> stock: 114857172 >>> asm: 112082057 >>=20 >> No Reviewed by? More than one pair of eyes on non-trivial assembly is >> almost always a good idea. >>=20 >> Jess >>=20 >> _______________________________________________ >> dev-commits-src-main@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main >> To unsubscribe, send any mail to = "dev-commits-src-main-unsubscribe@freebsd.org"