From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9317C433EF for ; Thu, 9 Sep 2021 10:27:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4BD7761186 for ; Thu, 9 Sep 2021 10:27:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4BD7761186 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 785896B0071; Thu, 9 Sep 2021 06:27:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 70E306B0072; Thu, 9 Sep 2021 06:27:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5AE58900002; Thu, 9 Sep 2021 06:27:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0155.hostedemail.com [216.40.44.155]) by kanga.kvack.org (Postfix) with ESMTP id 42BB16B0071 for ; Thu, 9 Sep 2021 06:27:17 -0400 (EDT) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id CACC6184215F8 for ; Thu, 9 Sep 2021 10:27:16 +0000 (UTC) X-FDA: 78567657672.02.EFCFEE6 Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) by imf15.hostedemail.com (Postfix) with ESMTP id 83A37D000099 for ; Thu, 9 Sep 2021 10:27:16 +0000 (UTC) Received: by mail-ed1-f41.google.com with SMTP id i6so1986019edu.1 for ; Thu, 09 Sep 2021 03:27:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=Fmq3R4ZzK2rAO3gtoZe7iYBGOdxKYabfT96jQR65EQ0=; b=7erA1EZiGd5spQS/qEDUUbWLleEfgZhuqqd9vM3KS9aE7zoDm1QfFnOUO/ECKDV+Rr SMyZKLB5Y0HwW4UmT3scFXDOSIBBOmPGuyfWkItpIa5oSo4r7L2lG+EkMmwTj+IMNZkU 0CfaM82s+K5bLNqRIOVOt6NQ0Hn9CPK0tS9lTzlO0HOkRMYpMFBSVDfu/Kb+V665f6yA pTRVSWmCzLUNzhmCfNdymaRvXImgqiRxL9+WdTSEQmW1p48woExfEOUj0m3ZCxvcpnlt MUVIauQE0K6Qh7RW+sqoJv1bJROsiCQ+FODSgLDX7b1kEDRKRNQpU+ebHjZsnyXcTHwr QlSg== X-Gm-Message-State: AOAM532ClpjjwrAApPxCw8csY9mPp6pDh3PfpIDxIsjRRSWi77DVo62M +qGRPNhTEcGLrBUiW5OsSog= X-Google-Smtp-Source: ABdhPJwa3QgmvV6CY9V8hVwgXd8pOc2trfZsiDNrMpJTNaYnidnxLtkTHRS6tiG+t8xaqTbpgYk8SA== X-Received: by 2002:aa7:c80a:: with SMTP id a10mr543597edt.174.1631183235170; Thu, 09 Sep 2021 03:27:15 -0700 (PDT) Received: from localhost (mob-83-225-149-177.net.vodafone.it. [83.225.149.177]) by smtp.gmail.com with ESMTPSA id bi3sm871591edb.91.2021.09.09.03.27.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Sep 2021 03:27:14 -0700 (PDT) Date: Thu, 9 Sep 2021 12:27:06 +0200 From: Matteo Croce To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, Andrew Morton , David Laight , drew@beagleboard.org, Guo Ren , Christoph Hellwig , kernel@esmil.dk, Linux-MM , mcroce@microsoft.com, mick@ics.forth.gr, mm-commits@vger.kernel.org, Nick Desaulniers , Palmer Dabbelt Subject: Re: [patch 103/147] lib/string: optimized memset Message-ID: <20210909122706.58d9fe20@linux.microsoft.com> In-Reply-To: References: <20210907195226.14b1d22a07c085b22968b933@linux-foundation.org> <20210908025845.cwXLsq_Uo%akpm@linux-foundation.org> Organization: Microsoft X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Authentication-Results: imf15.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=linux.microsoft.com (policy=none); spf=pass (imf15.hostedemail.com: domain of technoboy85@gmail.com designates 209.85.208.41 as permitted sender) smtp.mailfrom=technoboy85@gmail.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 83A37D000099 X-Stat-Signature: tukof5nb1egd7g9u4zm7tesnwgqzzt7o X-HE-Tag: 1631183236-571573 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, 8 Sep 2021 11:34:27 -0700 Linus Torvalds wrote: > I'm dropping this one just to be consistent, although for memset() > it's possibly a bit more reasonable to fall back on some default. > > But probably not. memcpy and memset really are *so* special that these > generic versions should be considered to be "stupid placeholders for > bringup, and nothing more". > > On Tue, Sep 7, 2021 at 7:58 PM Andrew Morton > wrote: > > > > On a RISC-V machine the speed goes from 140 Mb/s to 241 Mb/s, and > > this the binary size increase according to bloat-o-meter: > > I also react to the benchmark numbers: RISC-V already has > > #define __HAVE_ARCH_MEMSET > #define __HAVE_ARCH_MEMCPY > #define __HAVE_ARCH_MEMMOVE > > in its file, so these are just odd. > > Did you benchmark these generic functions on their own, rather than > the ones that actually get *used*? > > Linus I benchmarked against the generic routines. The RISC-V specific are even slower than the generic ones, because generates lot of unaligned accesses. That was the whole point of the series initially. These C routines should have replaced the risc-v specific assembly ones, but then it was proposed to use them as generic: https://lore.kernel.org/linux-riscv/YNChl0tkofSGzvIX@infradead.org/ -- per aspera ad upstream