Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp395568pxb; Thu, 9 Sep 2021 03:29:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyoO5fcOl24MRP4esVSCjGPGoEFU4pPf2SpUNUwE6dyr2szzZCZ4jySE5PNZX2rfIH66mfA X-Received: by 2002:a05:6402:430f:: with SMTP id m15mr2395492edc.115.1631183356176; Thu, 09 Sep 2021 03:29:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631183356; cv=none; d=google.com; s=arc-20160816; b=gztTEXbpeMrFRCbrvjGFn5juoogf7VLkIhST7CId18jCEnbss8mqJFfTb02C/0Kwx3 selC1fpduGyjKjALY2Zf7JAtLZCsMeTKYUYCYBTxryA05ZSZxPsoRxU2KPg0U5sSfjFc HA0N3tHsf21O3a27JHgvxoqxatUrUVTZOYOT0p+F2U+rLQoTwOGzvPbSLUb9LPRV2FNg AbNmBkHq877Gxt+bOokAJyKAMNY7emLGs5xDY01OKPCiKP4kZCQ4PKBNa/b/Ktz+TExF dRC4zlwjrUMeZ0dgaYdVMm/oL6jbxauH7lZDnJMHcu+vqkXNaISiaom+k66FTaMtIpNO 7SxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=Fmq3R4ZzK2rAO3gtoZe7iYBGOdxKYabfT96jQR65EQ0=; b=jtFlCLDqucR8la/gCqMImhVBv5QAPDMkH5wv6N1OOT8HRC6OZJQarn0NHsslUN+iB6 9S2uu2zm3b+ioppmtRF4PfeAd5B2PVZV9lcm4qz++Iy1YZEFFajFzfChDFTxiIZP+dCg gpmBl5jz3imoYBy1WIXmGLpB1iLqgnw5sjWDzjPGK3CCbIBVVRk6IiicbYktW9nmhSwy XgiAthhu+R3NVKpQV7H1QiAngPbuv2ZGcDxAtw9aa8fq0y6taSlzgqsJGyXI8y1DoBFh sdk3QjeNXujpyl1rA7Cf2OL7snoBlm5LwFu0Jkq9BlcUaAaYEnchBaRwu25mSBh2dBaR dFug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p31si2118790edb.495.2021.09.09.03.28.51; Thu, 09 Sep 2021 03:29:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233654AbhIIK21 (ORCPT + 99 others); Thu, 9 Sep 2021 06:28:27 -0400 Received: from mail-ed1-f50.google.com ([209.85.208.50]:45888 "EHLO mail-ed1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229980AbhIIK20 (ORCPT ); Thu, 9 Sep 2021 06:28:26 -0400 Received: by mail-ed1-f50.google.com with SMTP id g22so1943900edy.12; Thu, 09 Sep 2021 03:27:17 -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=T1mtuJ2B6y6tUjUrhuNBYjqfgjNBNQOJXbjWrnFkTCWsPVuG5DoGd6Q9hbJETqk3FJ lf6jCFY9G9PZQYaehFXLeSemw27dR6u4SdvSLQgRXssABMfKFnJ0NcpYjjDqIhJdea+Z BECgFtSL8mwL8QTQ8/cQc3sq1Vt13vvecbvMby7Ztwa6Yo2sAdjOxKGroweX5eFP7ZMp gAv8h/OIxrnvs13xmfL80m6ChOiWbwLyXJImHPErXHjkqzLW8+kaYdfSKmNVW0BYq/FS /ASBUR1eaXSxo+PVSE6RfkqWnFSDtqrouJzE1QX38rtveKctue/n3bMzzqcKiMKl5PY2 aUEg== X-Gm-Message-State: AOAM531Plqn4lL9T9YzWHa8VhTzccY50WMNHryw60E2WWWxGRZYCcQG0 +azJQdc+8LUp139vtsRW0czKelobm5+QVg== 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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