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=-11.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 03442C433B4 for ; Fri, 14 May 2021 14:56:55 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B763861442 for ; Fri, 14 May 2021 14:56:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B763861442 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Rrol4JdoHSD7eq0a9OskzjyFJHNktT8JQMdMTJ0bcUQ=; b=TfLb8ddb8DPrfYIjpDsW5sc0Y qBnV1FkOKelnNNCLIeJrnMQq6+ncsjC5Ymgh4WmJ8D7KOpJbfeGXH+PzXFU1l+OVeC0UPuOgocNwX wX7rErIlmjJe1aNPiCv6yCKKYAPS1BwPsvS4JKLUkwSGmK+XWe3YIKY6jwYPm+Yai7tYP+C2D4xfQ psDuZ1fmDlWb5YbGw0/45hoqXH2HB9GkJWk5PWapCkkep9twYKqYpSsobqoW0Fh7cQEEkANbJXrV0 CB1et6TjgMwkasVVlHKRPDA85HdClnrheEV7TWRt2jm1Z/8Wzl1qk6bYBpgwZHLqITbEm6R/PBZKl r3BhpuuXA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lhZDm-008Ldx-RD; Fri, 14 May 2021 14:55:22 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhZDk-008Ldd-8q for linux-arm-kernel@desiato.infradead.org; Fri, 14 May 2021 14:55:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=HroZ8fcS0SZaEm40i7ijkeOb81k9LkoB1BS8PWrjDxc=; b=pJhOy6srMn2N1BhFAtX9xLQyKH fllHe9bgBabwgt4clhqlTQgy7TT+K0RgO1S/XAs/SQiagcuATVRnZjvohBh723dinP49Q3DPN4/7Y Xhj2fYBn1++bqpFaP94lKdzKsK+ePwATm716EeQdslIDU5/QpB+0C0mc/j0pggqSpYuzrbsQQUepn fUxs4R6C61mvMxkQ+i/CNnsJmaCbA5THQcN4SoxFUQpYzeApEp3PY+yz7tZVvv98pC7QtyPtaRwFX Ar7yb4AIVX7OKZpCK3C1fjY+EEv+AmTlwxINH9wtAIHnJKe00WVUPeZy7TFE+nODePPZeMRXMVeHp kz5usP2g==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lhZDh-00C3wl-Hz for linux-arm-kernel@lists.infradead.org; Fri, 14 May 2021 14:55:18 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3588F611CE; Fri, 14 May 2021 14:55:16 +0000 (UTC) Date: Fri, 14 May 2021 15:55:13 +0100 From: Catalin Marinas To: Robin Murphy Cc: will@kernel.org, linux-arm-kernel@lists.infradead.org, yangyingliang@huawei.com, shenkai8@huawei.com Subject: Re: [PATCH 7/8] arm64: Better optimised memchr() Message-ID: <20210514145513.GB28888@arm.com> References: <68d3229c208780fdde88ba48e14fcde8c50f6e76.1620738177.git.robin.murphy@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <68d3229c208780fdde88ba48e14fcde8c50f6e76.1620738177.git.robin.murphy@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210514_075517_634782_BC763B68 X-CRM114-Status: GOOD ( 12.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, May 11, 2021 at 05:12:37PM +0100, Robin Murphy wrote: > Although we implement our own assembly version of memchr(), it turns > out to be barely any better than what GCC can generate for the generic > C version (and would go wrong if the size_t argument were ever large > enough to be interpreted as negative). Unfortunately we can't import the > tuned implementation from the Arm optimized-routines library, since that > has some Advanced SIMD parts which are not really viable for general > kernel library code. What we can do, however, is pep things up with some > relatively straightforward word-at-a-time logic for larger calls. > > Adding some timing to optimized-routines' memchr() test for a simple > benchmark, overall this version comes in around half as fast as the SIMD > code, but still nearly 4x faster than our existing implementation. > > Signed-off-by: Robin Murphy I haven't reviewed the code yet but wondering - could we write this in C using load_unaligned_zeropad()? -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel