From patchwork Sat Jan 16 15:01:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Lobakin X-Patchwork-Id: 12024955 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=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 3A5C3C433E0 for ; Sat, 16 Jan 2021 17:30:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ED69722AAF for ; Sat, 16 Jan 2021 17:30:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726997AbhAPRav (ORCPT ); Sat, 16 Jan 2021 12:30:51 -0500 Received: from mail-41103.protonmail.ch ([185.70.41.103]:44521 "EHLO mail-41103.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726917AbhAPRav (ORCPT ); Sat, 16 Jan 2021 12:30:51 -0500 X-Greylist: delayed 1622 seconds by postgrey-1.27 at vger.kernel.org; Sat, 16 Jan 2021 12:30:50 EST Received: from mail-02.mail-europe.com (mail-02.mail-europe.com [51.89.119.103]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by mail-41103.protonmail.ch (Postfix) with ESMTPS id 6B8FC2000A68 for ; Sat, 16 Jan 2021 15:03:33 +0000 (UTC) Authentication-Results: mail-41103.protonmail.ch; dkim=pass (2048-bit key) header.d=pm.me header.i=@pm.me header.b="LSNpXC3d" Date: Sat, 16 Jan 2021 15:01:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1610809327; bh=EZcb4JPboRMaIJED6qHefe7v5f3cTWgIwS+L2+WZgls=; h=Date:To:From:Cc:Reply-To:Subject:From; b=LSNpXC3dm6RptrTUPwvFgxXyRviBwprpEyfyXbpJ/SB1HEwiG+8pj5VWQztrLQT1k O5Ac0LtvC2waSTef8PpY12pNjTmyW3ZDMU7WLGbhn+QzmJiE9scuOy6NWcSubrygsg OMHAANZDAgeYRbThwrjb3I4AXgYTn2rWmeYQs6jYTzy9ASUnWGiGgyFxHtj0TxlQLe 4omepypPI+WeJHviQNXjTQwlpansq1CRghc2fse3zblGnpkJJ1HrB/5ptQT3y/VWGh 8hBRQuot4X8SJydRCnIqKgogwF/mHRZu+siUqHnKFOtxvHLpdNYsBhq/JpPwxiYHp8 bnkQ7j0lcJX9g== To: Thomas Bogendoerfer From: Alexander Lobakin Cc: Nathan Chancellor , Nick Desaulniers , Kees Cook , Andrew Morton , Mike Rapoport , Alexander Lobakin , Jinyang He , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Reply-To: Alexander Lobakin Subject: [PATCH mips-next 0/2] MIPS: optimize relocations processing Message-ID: <20210116150126.20693-1-alobakin@pm.me> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org This series converts the logics of two main relocation functions, one for relocatable kernel and one for modules, from the arrays of handlers (callbacks) to plain switch-case functions, which allows the compiler to greatly optimize the code, so the relocations will be applied faster with lesser code size. Tested on MIPS32 R2 with GCC 10.2 and LLVM 11.0 with -O2. Alexander Lobakin (2): MIPS: module: optimize module relocations processing MIPS: relocatable: optimize the relocation process arch/mips/kernel/module.c | 109 +++++++++++++++++------------------- arch/mips/kernel/relocate.c | 54 ++++++++++-------- 2 files changed, 82 insertions(+), 81 deletions(-)