Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2338552imm; Mon, 28 May 2018 06:19:50 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIg+BTwLNcuI+PSiUzxOhU9Hg/saPIf8RO8Mrh8QO44dCqPNOwnmeKyh8extXJvCeiWdKQh X-Received: by 2002:a65:6007:: with SMTP id m7-v6mr6603868pgu.92.1527513590496; Mon, 28 May 2018 06:19:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527513590; cv=none; d=google.com; s=arc-20160816; b=U6gfd+7HpkqE/Jg9nM1WPqbLs7Sl3/ai50qTbkdkgIB1bwaZMSvuNXMfCJgvZjz28g tuxO8f04ko0ytLExhsutCEeVHzz3WVdErfSt59Gtacb+Z2/zBQEfZCFAaHZLpMoXVhpT 6+B5g4ojrlKVgtooyBS7Cb8tLzOyltTQU63XPuWfmSO/F3FczKvVCu/JikeCRhz4oVcS GJO6sBEDhf5N8OeuGIOESJT5f7WtC7gKVZstfl9Q013Jf+qCDHFXsLb+skapvQ4DZhnM W/UqByRK8wvdsAdVti2TpmtQ9w9pIAzagyMVfwnEkcuv2B8ktODVOnYp3qZ0+PqH+KcY 9qjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:message-id :arc-authentication-results; bh=a2A7VzjGqtPI2DWsXtnvknBqhA1udfbVplccqtIVGC4=; b=MtyB7E38qq3bfKIZK/liNKXCBK3gFjJORL/MXqhNjSNy4uBxdiG+76cDXKCjaomGnb Z0LM3n0RhGDMQ2A1CT4dT6O6d2DYF7LSRBs3o7hgmKzclmybTlzSiapOr6doiXY1Qk5Q GRn5EHMYEJMz17hdpK/88vx87U+MNcwqIBKDJtPOGLh/VHOJcsHI2/jvGE/soaSGDzup BoS/pqwMojNGuFlU7ypOgAAB3b8kioSnRCaRsbL54GXCjQLmbRjvVGJ3ZY2fbYsBAVk+ YLR20EhzB+U18BbNIaQV7MxZztGpYI85M0SSkZvyMiqrabE/MEhFfYmY2vpSAzwDiuN4 aPLA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r17-v6si10282398pls.597.2018.05.28.06.19.35; Mon, 28 May 2018 06:19:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425064AbeE1NRv (ORCPT + 99 others); Mon, 28 May 2018 09:17:51 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:51860 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163251AbeE1KuB (ORCPT ); Mon, 28 May 2018 06:50:01 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 40vYXC3LFyz9ty6q; Mon, 28 May 2018 12:49:47 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id A8pAoispC4Hr; Mon, 28 May 2018 12:49:47 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 40vYXC2jX8z9ty6Y; Mon, 28 May 2018 12:49:47 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 951E28B971; Mon, 28 May 2018 12:49:52 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id E2TyfyHXylWo; Mon, 28 May 2018 12:49:52 +0200 (CEST) Received: from po14934vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.231.2]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 63C018B96E; Mon, 28 May 2018 12:49:52 +0200 (CEST) Received: by po14934vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 3A0A06F10C; Mon, 28 May 2018 10:49:52 +0000 (UTC) Message-Id: From: Christophe Leroy Subject: [PATCH v5 0/3] powerpc/lib: Optimisation of memcmp() and __clear_user() for PPC32 To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , segher@kernel.crashing.org Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Mon, 28 May 2018 10:49:52 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This serie intends to optimise memcmp() and __clear_user() for PPC32 in the same spirit as already done on PPC64. The first patch moves PPC32 specific functions from string.S into a dedicated file named string_32.S The second patch rewrites __clear_user() by using dcbz intruction The third patch rewrites memcmp() to compare 32 bits words instead of comparing byte per byte. As shown in each individual commit log, second and third patches provide significant improvment. Changes in v5: - Removed the handling of Little Endian, as PPC32 kernel only support Big Endian at the time being, and because unaligned accesses should be handled differently in LE. Changes in v4: - In memcmp(), dropped the special handling for when length is 0. Handling it through the small length path. Changes in v3: - Fixed the sign of the result returned by memcmp() by using a logical comparison of u32 words and returning -1, 0 or 1 instead of doing a substract. - In first patch, replaced PPC_LCMPI by cmpwi - Fixed licence in string_32.S - Removed the two last patches from the serie. They will be handled later as they require further tests and analysis to properly identify their real benefit in all possible cases. Changes in v2: - Moved out the patch removing the hot loop alignment on PPC32 - Squashed the changes related to NUL size verification in a single patch - Reordered the patches in a more logical order - Modified the inlining patch to avoid warning about impossibility to version symbols. Christophe Leroy (3): powerpc/lib: move PPC32 specific functions out of string.S powerpc/lib: optimise 32 bits __clear_user() powerpc/lib: optimise PPC32 memcmp arch/powerpc/lib/Makefile | 5 +- arch/powerpc/lib/string.S | 61 --------------------- arch/powerpc/lib/string_32.S | 124 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 127 insertions(+), 63 deletions(-) create mode 100644 arch/powerpc/lib/string_32.S -- 2.13.3