Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4178078imm; Wed, 30 May 2018 00:09:08 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ3G7XJfjD+pPZNRj/lIHt5Za72RBd6ZJ9BIwF0tJfbgunIlIVejzFF0T+Fv/NDpV4SV6Ii X-Received: by 2002:a62:b204:: with SMTP id x4-v6mr1638195pfe.21.1527664148133; Wed, 30 May 2018 00:09:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527664148; cv=none; d=google.com; s=arc-20160816; b=iSCf+qR0ZUejdulLMvdU1fVABmaDiatdbYJhBRTpj9iXx3kyCQSsKR42qFVpvEceB9 zjpWLvycxQsusjB93o3rIb9mumw5jgzhKcCcZrKfxjE7R6aMMsDwx+7NP8PfmwC34fTX RCQB4C6RqVF75MMMXDAZdUybR5c/ErwTSut85nybxxPKsuJGUMFUcTDfLW6uG5qQkq9I LL0k1KrJQW2lxj0P1q2g2tlPOOApPl68ehGhklShpKSp9enEdcxlWR+askYGIhOrWi4Y SMpbm9n9M7Lj/09kBO3upC3xrSsu7KlhAvqcZjHNFv8qPb0uHzd8W47JZgrs5uj3zey/ VYkw== 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=7EVTL1+FlmXJQ5Pv4U/k370w1rMav0/Dpmzo7wiMNX8=; b=ZtIJoSKj8pVaOjQyRJHKbvUz41fPF4+uftvoc/lTthXaW466lx0yeKm3VbluiXs7/v EeB6OBGHYNzCJf3ne1t/lWxlhJVCFdypKsXDuQ5HkEmSw1iNyO5c/4AnAIVVH1XRt4qF aShYQIW7uA9ynyXHv7m2iILfo4Cw3ZZXbCy3kU+ZBiJnrdNTCEjJKIim80uhcgqQfFGN H0/rhqU5w7ErOLIxtZ6ZM96EVXae1k9pNsIxUP444CGe4MxVHX5+wUE7rstWe17cO852 vK5L8rt4nOuZo7XrZJbi1H1ZRWOU8lCVBZAoveHMVdtUH9S6j5/dN0TvwiIrIhnLUBcb QdGQ== 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 p7-v6si33101336plk.293.2018.05.30.00.08.53; Wed, 30 May 2018 00:09:08 -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 S967555AbeE3HGO (ORCPT + 99 others); Wed, 30 May 2018 03:06:14 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:42757 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935905AbeE3HGN (ORCPT ); Wed, 30 May 2018 03:06:13 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 40whTJ0CqFz9tvMx; Wed, 30 May 2018 09:06:12 +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 kSHwIOvE1_PH; Wed, 30 May 2018 09:06:11 +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 40whTH6r01z9tvMf; Wed, 30 May 2018 09:06:11 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 525668B7BB; Wed, 30 May 2018 09:06:12 +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 49mzsEIFCiCc; Wed, 30 May 2018 09:06:12 +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 34AAB8B752; Wed, 30 May 2018 09:06:12 +0200 (CEST) Received: by po14934vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 0A2C96CCAC; Wed, 30 May 2018 07:06:11 +0000 (UTC) Message-Id: From: Christophe Leroy Subject: [PATCH v6 0/2] 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: Wed, 30 May 2018 07:06:11 +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 rewrites __clear_user() by using dcbz intruction The second 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 v6: - Dropped first patch of the serie which was just moving memcmp() and __clear_user() into new string_32.S file - As suggested by Mathieu, to be consistant with PPC64: - __clear_user() is moved into new file string_32.S - memcmp() is moved into new file memcmp_32.S - Removed unneccessary included header files. 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 (2): powerpc/lib: optimise 32 bits __clear_user() powerpc/lib: optimise PPC32 memcmp arch/powerpc/lib/Makefile | 5 ++- arch/powerpc/lib/memcmp_32.S | 45 ++++++++++++++++++++++ arch/powerpc/lib/string.S | 63 ------------------------------- arch/powerpc/lib/string_32.S | 90 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 138 insertions(+), 65 deletions(-) create mode 100644 arch/powerpc/lib/memcmp_32.S create mode 100644 arch/powerpc/lib/string_32.S -- 2.13.3