From patchwork Fri Jul 1 12:54:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 12903262 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 421A2C433EF for ; Fri, 1 Jul 2022 12:55:45 +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=1ombU5UjhzDYA2Fcrr8qGAuV9YwArAusUnjGjQpCc7c=; b=Ukj951xNpkBxYr hv9Oi9shxXFnKkk7QgKuP2VYTqJIGptRBIfrpitDHV8radSh9nsbQiiFErGpgnQO+RyvzFFty/rIb 2kYgcR9aAZGipDd7Fn2QDwgi1yD4jQLkqIfTtVuv2oQBhZzo2BkVFmc+ZFywjKYdPHPi4UUM/7apf BYFPB4Wrc2XLUc1QvXZu1eANS7sph38KZ6OM5GFQwBNnfRF4gHPYgm6UQjug2M4yqcaglsszoI2wF N2KKEoncMbZM/2e2rf+Pumb1dTaemY8SpJaVyFK+U8MXIgPLRSZW8GIsPYQDAJaaH+TNVBsokBKfE eKck2vWQO2x+drmjoRIg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o7GAR-004rYm-NF; Fri, 01 Jul 2022 12:54:39 +0000 Received: from mail-qt1-x831.google.com ([2607:f8b0:4864:20::831]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o7GAO-004rXO-Kq for linux-arm-kernel@lists.infradead.org; Fri, 01 Jul 2022 12:54:37 +0000 Received: by mail-qt1-x831.google.com with SMTP id l14so315991qtx.2 for ; Fri, 01 Jul 2022 05:54:35 -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=cB0N8Sfsl7ydrt89ELVtEtpHxTBOqHu1NNNG72ZHfPI=; b=kyTff5FBVAJW0oklQUk+p2vs026FoEBJ4rpHQGRsno8WbiGN6MLahpAiecizK+qTWS 5cptyI+RlnUe9RA+nwpOh+Ln5oSOtEdZstsazskajbVuyLTtm5ov5qFpRf70c48/4aFt mHbL/Dz44aS+DbU5DAxStuy6be4PRynPjDcB+4OOkUjuLp5WkWGwerIXokvOyu3nX+Dh m0qouNYexpo32TD17Yf2wsuaRb/Kg3GkeI8h07NfkGn/Nj5g79ifwMGhLyUmvRY62tk5 BouCf3qSges6BOL/8ba//ds3L3tdvV//VOQMWfFNfkdTLGXdVmUYcYKFok30W+5lkQb/ gBRw== 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=cB0N8Sfsl7ydrt89ELVtEtpHxTBOqHu1NNNG72ZHfPI=; b=6S12CmnXa99J3UegnJNGnsXZWFY9a96IYRZx4ZV0dfjWxyjZTQsoV8G79jvkqun9sq 3gLv1EaGP9vrYiekFPet/+vLuSX/1NBCwMFIwB91tSiphUPVP579tK559x9FvK72DiT9 0VmkCuaLgVFyff0UCgrH8y8GTr0GdnmU8QFe2Zgikn0xs5yYjpATz7awpywZ4KAnxRL9 fFZCNV7EYmiybwzqaNkyovtg5pke4xLd7hQ63+U4LQwf7ZqnsQsr4VJjHfgvPuswIH7r yqG6rKKUHMuE+n+Y4Ww9W9arfMa1a+tGVa4MfCM40GmYIWFgdTFdCOISwVcYFA0ZvjMw dywQ== X-Gm-Message-State: AJIora/eGpyz9po7o++r/Qm4ql3SsZLOK+e57g8Xfx8uS79XKJqp8Pte 0vUi0Z0Kykov230LgsAnql8= X-Google-Smtp-Source: AGRyM1vgpEU2SWOmHoiPTLl71LpcpYpHpmt7pAvqDIR6NabZC84wEX8F6AAvp7S/yxeLcr2lAHBtMQ== X-Received: by 2002:ac8:578d:0:b0:31a:e1d7:952a with SMTP id v13-20020ac8578d000000b0031ae1d7952amr12367208qta.103.1656680074516; Fri, 01 Jul 2022 05:54:34 -0700 (PDT) Received: from localhost ([2601:4c1:c100:1230:f902:9816:653f:2f66]) by smtp.gmail.com with ESMTPSA id ay4-20020a05622a228400b002f39b99f69csm14026933qtb.54.2022.07.01.05.54.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jul 2022 05:54:34 -0700 (PDT) From: Yury Norov To: linux-kernel@vger.kernel.org, Andrew Morton , Andy Shevchenko , David Howells , 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 0/8] lib: cleanup bitmap-related headers Date: Fri, 1 Jul 2022 05:54:22 -0700 Message-Id: <20220701125430.2907638-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-20220701_055436_724751_F00614B4 X-CRM114-Status: GOOD ( 11.55 ) 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 surprize me because modern compilers are more agressive in inlining, loop unrolling, and other techniques that increase size of the image. Yury Norov (8): arm: align find_bit defs with generic kernel lib/bitmap: change return values to bool where appropriate lib/bitmap: change type of bitmap_weight to unsigned int cpumask: change return types to bool where appropriate lib/cpumask: change return types to unsigned lib/cpumask: move one-line wrappers around find_bit to the header mm: split include/linux/gfp.h 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 | 20 +- include/linux/bitmap.h | 10 +- include/linux/cpumask.h | 125 +++++++++-- include/linux/gfp.h | 334 +---------------------------- include/linux/gfp_flags.h | 338 ++++++++++++++++++++++++++++++ lib/bitmap.c | 9 +- lib/cpumask.c | 97 +-------- tools/include/linux/bitmap.h | 12 +- tools/lib/bitmap.c | 6 +- 11 files changed, 483 insertions(+), 477 deletions(-) create mode 100644 include/linux/gfp_flags.h