From patchwork Wed Jul 6 17:42:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 12908430 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1124EC433EF for ; Wed, 6 Jul 2022 17:44:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=J05rdm9456eHFkGjHT3h/WXb92QpmBaOkF4FwE/lqLs=; b=sotaEhgfzVfa/c kaoUixLezOT8e5qV+5JNYm/zBn5SQSOWQvDoApWKw2mdCMBl+f4fb1hrf8kRHJ395GnpnnfPlki1E Gk1jBTgxq6HNKJoTBzjKJswum7Ql8iEMlH9obAYt7vwGsATaN7dZ1gO8Qc9zsoyrm8WbM3UjZ3WHW 9yQXn4BgE38Uaogee6fJ91qStY2I1iLUjJz8SsMzx3FbKymHuxzNJhDROJmOXxq0rsIFRpcg5DZfe yWK6/dQtCsCQFF6j3wzdLBZLIfRmgpTs9i1nriQ6J96SBKW+xw3oj+ML+vGD6xgKxGtDWKOpzWDHH 4Dr66IsasZP2DrQfJltg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o993I-00BlrR-77; Wed, 06 Jul 2022 17:43:05 +0000 Received: from mail-qt1-x82b.google.com ([2607:f8b0:4864:20::82b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o993C-00Bloo-JJ for linux-arm-kernel@lists.infradead.org; Wed, 06 Jul 2022 17:43:00 +0000 Received: by mail-qt1-x82b.google.com with SMTP id c13so19252374qtq.10 for ; Wed, 06 Jul 2022 10:42:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HRbOPX+WUhFrYKzoluCaxZY8LvvDK+k9pUsQcmDb/F4=; b=Pxoxj03ulPHDq4s/o3TDl5U4j+O7JiUekxDtdlCXDdGnjrsbJnMEZGTURMn861MU7e BQP60+I9xORkdZAwAYzG4TIX7IaP+Mfkvhi0ATpmszHnbJZMq2nKTPlM7VhuvEZO+66l s+uHKfOUcetPpF5ybi67JsxkLL2oztdS4Oldr13AxJlaT9ZHH9UYHbvQpZVxLwAGguki XCJA2QMrffL6IPiE3sbKQVu/jLDukYhiUhKk0yrE1Yi9QadotWeHxAEtBkhCe4tpR/qZ h3nmaPO//KzjDQEfn0QcdkCxFcWawqlTa2ZRWrYHNbt+kTclrt9Bq3PRCK0fLn+em/It +tfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HRbOPX+WUhFrYKzoluCaxZY8LvvDK+k9pUsQcmDb/F4=; b=zLlylFyll0u3meW2j0ofYpz6n48EtKDA0LpUm2vpkO1kH7+s7QOJfWm8eQvG1Yekvi j0pndExjnfmhDpsWBp/I6BEXVjL75YxKeT0NGbFCfxLVgzy9Yk4oG0Ved2f26f3VJ2zq KbGjziPjr39bhqyA5qH0gpGcYUHh+z8MwhibzK0oP6Ysvtt+iSZjaCLC9Nxw2Xlk7e59 fq3F2dFdGfJYcNNxKaU4dwuS56pmsHx4a8sV8ovXWQfYfxBo8YXiWyEptOJs5xiRxJ7v YEfiPRdJe/tswNFd1V9v6XuDxdpTY0MACYgLEHL9ZqyTSqX6N4UW3q5A0jo05QOx/6vh 5XwA== X-Gm-Message-State: AJIora/9A9g16OprELsHxhWGKD8/rfyQTUOax1CsIfvW/SsVkyuu4DXD 9FibcGZKNqyOJKN3fvPUT0E= X-Google-Smtp-Source: AGRyM1sYo9q4pC/HP6vE7tooa9UhswxdS7S6YLHmNuAfjoqgpdDE4ytFctniTnj4EBTjrzSoMj71LA== X-Received: by 2002:ac8:5a47:0:b0:31d:2388:48dc with SMTP id o7-20020ac85a47000000b0031d238848dcmr33826913qta.80.1657129376423; Wed, 06 Jul 2022 10:42:56 -0700 (PDT) Received: from localhost (c-69-254-185-160.hsd1.ar.comcast.net. [69.254.185.160]) by smtp.gmail.com with ESMTPSA id k1-20020a05620a414100b006af039ff090sm33393108qko.97.2022.07.06.10.42.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Jul 2022 10:42:56 -0700 (PDT) From: Yury Norov To: linux-kernel@vger.kernel.org, Andrew Morton , Andy Shevchenko , David Howells , Ingo Molnar , Geert Uytterhoeven , Jonathan Corbet , "Kirill A . Shutemov" , Matthew Wilcox , NeilBrown , Rasmus Villemoes , Russell King , Vlastimil Babka , William Kucharski , linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org Cc: Yury Norov Subject: [PATCH v2 00/10] lib: cleanup bitmap-related headers Date: Wed, 6 Jul 2022 10:42:43 -0700 Message-Id: <20220706174253.4175492-1-yury.norov@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220706_104258_685356_E764A7D3 X-CRM114-Status: GOOD ( 12.26 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This series unifies declarations of bitmap-related functions and aligns return types with values that actually returned. Also, it moves one-liner wrappers around cpumask functions into headers, so that compiler has a chance to optimize better. With this series, GCC 11.2 for ARM64 with kernel v5.19-rc4: add/remove: 15/7 grow/shrink: 461/164 up/down: 14844/-4580 (10264) This +10K didn't surprise me because modern compilers are more aggressive in inlining, loop unrolling, and other techniques that increase size of the image. v1: https://lore.kernel.org/linux-mm/YsAzU3g2QpgmIGre@smile.fi.intel.com/T/ v2: - Align whitespaces in headers; - Make bitmap_weight() unsigned long consistently; - Pick 2 patches from Ingo's sched/headers series [1] that split linux/gfp.h, and drop my similar patch for it. [1] https://git.kernel.org/pub/scm/linux/kernel/git/mingo/tip.git/log/?h=sched/headers Ingo Molnar (2): headers/deps: mm: Optimize header dependencies headers/deps: mm: Split out of Yury Norov (8): arm: align find_bit declarations with generic kernel lib/bitmap: change return types to bool where appropriate lib/bitmap: change type of bitmap_weight to unsigned long cpumask: change return types to bool where appropriate lib/cpumask: change return types to unsigned where appropriate lib/cpumask: move trivial wrappers around find_bit to the header headers/deps: mm: align MANITAINERS and Docs with new gfp.h structure lib/cpumask: move some one-line wrappers to header file Documentation/core-api/mm-api.rst | 8 +- MAINTAINERS | 1 + arch/arm/include/asm/bitops.h | 18 +- include/linux/bitmap.h | 13 +- include/linux/cpumask.h | 125 +++++++++-- include/linux/gfp.h | 348 +----------------------------- include/linux/gfp_types.h | 348 ++++++++++++++++++++++++++++++ lib/bitmap.c | 9 +- lib/cpumask.c | 97 +-------- tools/include/linux/bitmap.h | 12 +- tools/lib/bitmap.c | 6 +- 11 files changed, 494 insertions(+), 491 deletions(-) create mode 100644 include/linux/gfp_types.h