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: 12903253 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84ABCC43334 for ; Fri, 1 Jul 2022 12:54:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 05AE16B0074; Fri, 1 Jul 2022 08:54:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 00A776B0075; Fri, 1 Jul 2022 08:54:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E14A06B0078; Fri, 1 Jul 2022 08:54:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id D15E96B0074 for ; Fri, 1 Jul 2022 08:54:35 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id A3E6E20CC6 for ; Fri, 1 Jul 2022 12:54:35 +0000 (UTC) X-FDA: 79638524910.25.6AA247F Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) by imf10.hostedemail.com (Postfix) with ESMTP id 496ACC003F for ; Fri, 1 Jul 2022 12:54:35 +0000 (UTC) Received: by mail-qt1-f175.google.com with SMTP id he28so315837qtb.13 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=RnqH2v1cK+HDMMnQ/EZ2H+VYX3R5GmhPC626IfnVauxLUX8lGBtSHFVR5SeLl8UlLk 1X2+UwYHHgFBa2AWwUF5rF44INNWpbfjnWOal2PJgWZxuaqxzbuGGpJLm4zdTGT5Lm+X RxgdR81SpxhmUNZudq1dePIVPr4Pf7kEXDH2hpocXoBvKvEE7SxwXwhtBInEZ0qLTrJ1 0H2XHCKnFxsSn78g2g31q7Z2RsUtz1lYg8uUOF/3zOJaF4FhuzEYmrEqMc+Ah5dOkyGB VEIo3ODtgr6IpqhJj28iSiaKnuw2/YbXb1Y3HyDJFivMICEI4XQ8kzYU6TY/Mx7OB7WF 59cA== X-Gm-Message-State: AJIora8FPi4FWKpXdjbPgJGGgo5Z84kBnwSsnoB4cfJKFo5x8VsBcSG4 Xx5rdsGQrDRwwwNXInnN+D4= 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 ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=kyTff5FB; spf=pass (imf10.hostedemail.com: domain of yury.norov@gmail.com designates 209.85.160.175 as permitted sender) smtp.mailfrom=yury.norov@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656680075; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=cB0N8Sfsl7ydrt89ELVtEtpHxTBOqHu1NNNG72ZHfPI=; b=xT0HA/dVLMW+k6x3moDJV8Vnf0tLwyARgHh2FjVRjnbv1T2kj2OHK19j8xh9fffKnfIt0l 84D8D+6s1csXxFoCnpZX3xipvxsBh2MKuiK78hajarS4Jzg62s5RpcYdnA1+fch7N3rTGj RTCoNr2QEMC1dUMmd56lEN99ZzVb05M= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656680075; a=rsa-sha256; cv=none; b=SD9Xgw+fvx3RbUDBZrOpTHEaBWJ6GCFa7vJo8874cbXgQn+WJLSE6ILPilbPflmoXQxKb5 mlN6RhWJLIOdo0LH6SBNc+hjmVZdMHwEtYfS77kl3rD3FtY4hf0R6f+6lTxP98TMbrnUHi tJUpsfpCk9F8yxKbE4hUW15NIvdPUT8= X-Stat-Signature: sdydb9q54nur4fua1yoe4ch4jok3cgxz X-Rspamd-Queue-Id: 496ACC003F Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=kyTff5FB; spf=pass (imf10.hostedemail.com: domain of yury.norov@gmail.com designates 209.85.160.175 as permitted sender) smtp.mailfrom=yury.norov@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam12 X-Rspam-User: X-HE-Tag: 1656680075-872768 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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