From patchwork Tue Mar 5 08:59:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kellermann X-Patchwork-Id: 13581853 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 33B4CC54E41 for ; Tue, 5 Mar 2024 08:59:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B35566B0082; Tue, 5 Mar 2024 03:59:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AE5736B0083; Tue, 5 Mar 2024 03:59:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9AD696B0088; Tue, 5 Mar 2024 03:59:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 8AA5C6B0082 for ; Tue, 5 Mar 2024 03:59:37 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 524F416073E for ; Tue, 5 Mar 2024 08:59:37 +0000 (UTC) X-FDA: 81862387194.24.3AEEC8C Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) by imf07.hostedemail.com (Postfix) with ESMTP id 7D0A640008 for ; Tue, 5 Mar 2024 08:59:35 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=ionos.com header.s=google header.b=eSK+Zf2p; dmarc=pass (policy=quarantine) header.from=ionos.com; spf=pass (imf07.hostedemail.com: domain of max.kellermann@ionos.com designates 209.85.218.46 as permitted sender) smtp.mailfrom=max.kellermann@ionos.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1709629175; 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-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=M6C3Skxl3JZ6I3Bn9M0Rkt7P+AkMJ9BXocPtViO8HyA=; b=ssO6DBsCc/oXBzupdqYyE7tgObV+nE6gqo+M+ypuU6OVd+McuTNwcdls17YkGjw6BilX+/ F4uXoqiJL3yvllRm67A08y5yaov9QW1Q37XmekBtGNayzNonJI8zAS9ij+/TYr7EGfsOPG ym87pfIrYREciVbN/V+1dDUAFwmkyCE= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=ionos.com header.s=google header.b=eSK+Zf2p; dmarc=pass (policy=quarantine) header.from=ionos.com; spf=pass (imf07.hostedemail.com: domain of max.kellermann@ionos.com designates 209.85.218.46 as permitted sender) smtp.mailfrom=max.kellermann@ionos.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1709629175; a=rsa-sha256; cv=none; b=ag3r9qHSdBI+MoOSviyAJmdiJHQn6JnHmhcNR+waZEGDb+xr8iKAIdMlLXaZZv0HCLpqy1 zZLEcgsKsPbbCnb3tHgMF9O53JzdsLHOakRZrWQvkbk/LwfShRic231E/y6iFnxYVvVxXs 7pPIwpPGInr6xTprBe7lD7Zf2Am9HEU= Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-a4429c556efso723557466b.0 for ; Tue, 05 Mar 2024 00:59:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1709629174; x=1710233974; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=M6C3Skxl3JZ6I3Bn9M0Rkt7P+AkMJ9BXocPtViO8HyA=; b=eSK+Zf2pxDolBYhtw2TQe3pB0C+3RoF/OfCdFtehBcjNJ+W+rcB9OLWW5T9fKujbLx sFuuyycPw9CnQ1lG+LFB7b+pRt5FZls8Cnm44GuhOCVSpZKvb+Lg9vjjSIjiIZsXhhZQ b+skxgUk73Hc5SbYNd1SvP7nYK/Vy9jh5leTBGZUH/UE+xlJabW6kdVCnTR/vTwofruv byeMm+XHHzVJepcM9j5WoHl63hTNxCQNghWxmO4gIFU04X/jZhx+8KrTkPd1/kop7lZI etkvwSj1OB7UlHdEJ7aHbcNr7J4hZGNHUKyEbjFlGhr/pPZ1AH+OFCLau+9Ipwb0sxYJ jrTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709629174; x=1710233974; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=M6C3Skxl3JZ6I3Bn9M0Rkt7P+AkMJ9BXocPtViO8HyA=; b=rZOMA4yIu7ehqtzMdiATksufdFA2xvDl3HCwZ+Mtb0F0JE0dztKzFtH/GxBgmCmkpp tz00a68bDLjNADKOgF8zF5z4AOTUfzSEH5i+gArZ6zlRXu1QHw2Aamd6Ucbm3GT9p0j8 32vDZc0Qj28pBUJz9OjRolRKQhYE1jJFEGQGfMkjPr0dVHqfS0tK/yne5Fnyw6PXvriR ukx36M0fW0hE3R2Q7yNtyhogwfK5vqEmct81KyV4K1VyhZFgwMokQSB+loPqjn7jubru trJwVMCgP8qjVKsKAGzR/SCs2AXPHUZB86GWVyyhsVlJdmV7v5MwuwF+OZe8y32WwSyt xklw== X-Forwarded-Encrypted: i=1; AJvYcCVjj/8OaanfZ7BDzsDFoxUaF8BNycfZrysFd8YMkk9O7zxEM5LB4I4n8ny/sHGSS9rH3ngw9aUjOtvbYhhhyr0V6Jg= X-Gm-Message-State: AOJu0YwNFpwZ0JJ2HQhp74gj077KXvxNpGpiqrFSokK296yMXFi1wTkf DIaD6bWiDMhlme3dyj9bWd7qnam41XPrVvUkfHDrCZr9mrfIRn6eweI2872Y3rQ= X-Google-Smtp-Source: AGHT+IFMPVTm56Kq7yCVlQCGm8leuaxurrmwoBlFPKo/035wjfo25tHyRCTnVjULXBx8bQ19QGpKYw== X-Received: by 2002:a17:906:eb16:b0:a45:3ad3:1f93 with SMTP id mb22-20020a170906eb1600b00a453ad31f93mr3324672ejb.44.1709629173710; Tue, 05 Mar 2024 00:59:33 -0800 (PST) Received: from raven.blarg.de (p200300dc6f010900023064fffe740809.dip0.t-ipconnect.de. [2003:dc:6f01:900:230:64ff:fe74:809]) by smtp.gmail.com with ESMTPSA id gs4-20020a170906f18400b00a449d12cdc5sm4453005ejb.119.2024.03.05.00.59.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 00:59:33 -0800 (PST) From: Max Kellermann To: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: willy@infradead.org, sfr@canb.auug.org.au, Max Kellermann Subject: [PATCH v3 00/14] Fast kernel headers: split linux/mm.h Date: Tue, 5 Mar 2024 09:59:05 +0100 Message-Id: <20240305085919.1601395-1-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 7D0A640008 X-Stat-Signature: pw1d9mktotognh7duspwcgq6ue1pdz46 X-HE-Tag: 1709629175-208651 X-HE-Meta: U2FsdGVkX19z1P3HmIvrWdLj5pUG3Sha6VmwJzkerNjcMjp69Q/L4yYA3ywJFJO+uMKIfKLRoxQOgirsyHK2XWglqdT+j6ohqN7+naDEBKw8hpBWnemhiyyZROwySIFwUQD3N5M08Tu9i8V6lyGaAnqQHoLBoORmrkacnylnDeY/Rj8WsjnzswIXX/oi7Gnuwsf7c/9Qa8nHeurahfnNm4461KujsSAzQHXE/zZniHUPQjlaPkd0OHCrriAplc0CeXmjGJyU0gEUKdCZM7Nq1Ivus7K4wJEoUhZRQGKWfI46mmWWObv3qQ8YeC35VFAoDRq3NNca/diJ5fdCeVzVb9kA5F6SXTVFk4//Xoj1QIgwFhI2MXd4139MSYiMMwXtRZtWQPvTl9m38cD1QjX6nIQ0UAOiw70Zjcy4/MN09rRH17pTTM245k36dWfIkFqms2FQGjMAhukScon71UWcH2pKD80UIlOlmPOvvexWyD/XoCE6jr/4mSwxSUUhjW79/G1MTwB/d7Rn3+4DPCLApSs9q0EHFs5Q8231m+b4J5PeqZBZmlC6yA1erB2IGu/YNSQnlomGr7LwmWMtRowYeQu8q8YoRd/j/3SC0N0SqDyesPpzGpEje3Xy70kHcXI2J/PVIbZvMSzORV21jA1s8Tjh3rPn+Hu/k42APqYyy9STSOs45yYAI6wW+yMBqN3aI8SOXvaFIZYt63hNddf5IIvxU1KiOe6Wv0fcNbUHZethJdXsmwuPl6eASZmV9JCQf7Iwvfjf4Lk7hJLedrrx38gjRNVwLD7/jdnrLEc1Q40raLZTkGgRpzhMA3hZRippAVwmGjV4bfAritLNwfSzEn77v+l1eaDijBcTPvjfME3xZJZmpKzVP3nRhCpI0oVfEDRzx4/yRbWwopbG/7T0DR1ePqOjVgbtRbXNjnwwySZusDnPT0u3z+e+7vgle88tiyGlLQELw4BpwlruI6Y MKWy/hap tft+ppwE4JPFplUhJoJ8kOq2S46QdrUOnUsqGWLXJ7yeUBrp6p/80hxFrV90QbZd0D5LHZMwzeA3t3tM= 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: List-Subscribe: List-Unsubscribe: This patch set aims to clean up the linux/mm.h header and reduce dependencies on it by moving parts out. The goal was to eliminate dependencies on linux/mm.h from other popular headers such as highmem.h and dma-mapping.h, and I started by checking which symbols were really used and moved those declarations to separate slim headers. --- v1 -> v2: added more explanations to commit messages; renamed several new headers from page_*.h to folio_*.h as suggested by Matthew Wilcox; rebase on linux-next; fix build failures on architectures um,nios2,hexagon by adding more missing includes v2 -> v3: rebase on linux-next Max Kellermann (14): drivers: add missing includes on linux/mm.h (and others) include/drm/drm_gem.h: add poll_table_struct forward declaration linux/mm.h: move page_kasan_tag() to mm/page_kasan_tag.h linux/mm.h: move section functions to mm/page_section.h linux/mm.h: move page_address() and others to mm/page_address.h linux/mm.h: move folio_size(), ... to mm/folio_size.h linux/mm.h: move folio_next() to mm/folio_next.h linux/mm.h: move devmap-related declarations to mm/devmap_managed.h linux/mm.h: move usage count functions to mm/folio_usage.h linux/mm.h: move page_zone_id() and more to mm/folio_zone.h linux/mm.h: move pfmemalloc-related functions to pfmemalloc.h linux/mm.h: move is_vmalloc_addr() to mm/vmalloc_addr.h linux/mm.h: move high_memory to mm/high_memory.h include: reduce dependencies on linux/mm.h MAINTAINERS | 1 + arch/arm/include/asm/memory.h | 4 + arch/arm/include/asm/pgtable.h | 2 + arch/arm/mm/iomap.c | 3 + arch/csky/include/asm/page.h | 1 + arch/hexagon/include/asm/mem-layout.h | 4 + arch/m68k/include/asm/page_mm.h | 1 + arch/m68k/include/asm/pgtable_mm.h | 1 + arch/parisc/include/asm/floppy.h | 1 + arch/powerpc/include/asm/book3s/32/pgtable.h | 4 + arch/powerpc/include/asm/nohash/32/pgtable.h | 1 + arch/powerpc/include/asm/page.h | 1 + arch/x86/include/asm/floppy.h | 1 + arch/x86/include/asm/pgtable_32_areas.h | 4 + drivers/comedi/comedi_buf.c | 1 + .../qat/qat_common/adf_gen4_pm_debugfs.c | 1 + drivers/dma/dma-axi-dmac.c | 1 + drivers/dma/sh/rcar-dmac.c | 1 + drivers/firmware/qcom/qcom_scm-legacy.c | 1 + drivers/firmware/qcom/qcom_scm-smc.c | 1 + drivers/firmware/raspberrypi.c | 1 + drivers/iio/buffer/industrialio-buffer-dma.c | 1 + drivers/iommu/iommufd/ioas.c | 2 + drivers/iommu/iommufd/selftest.c | 1 + drivers/media/platform/mediatek/vpu/mtk_vpu.c | 1 + drivers/media/platform/ti/omap/omap_voutlib.c | 1 + drivers/misc/bcm-vk/bcm_vk_dev.c | 1 + drivers/misc/fastrpc.c | 1 + drivers/misc/genwqe/card_dev.c | 1 + drivers/misc/uacce/uacce.c | 1 + drivers/mtd/nand/onenand/onenand_samsung.c | 1 + drivers/mtd/spi-nor/core.h | 2 + drivers/pci/p2pdma.c | 1 + drivers/pci/pci.c | 1 + drivers/remoteproc/remoteproc_core.c | 1 + drivers/soc/qcom/rmtfs_mem.c | 1 + drivers/spi/spi-aspeed-smc.c | 1 + drivers/spi/spi-bcm2835.c | 2 + drivers/spi/spi-intel.c | 1 + drivers/virtio/virtio_ring.c | 1 + include/drm/drm_file.h | 1 + include/linux/bio.h | 2 + include/linux/dma-mapping.h | 1 + include/linux/highmem-internal.h | 2 + include/linux/highmem.h | 4 +- include/linux/huge_mm.h | 2 + include/linux/iommu.h | 1 + include/linux/mm.h | 583 +----------------- include/linux/mm/devmap_managed.h | 37 ++ include/linux/mm/folio_next.h | 27 + include/linux/mm/folio_size.h | 150 +++++ include/linux/mm/folio_usage.h | 182 ++++++ include/linux/mm/folio_zone.h | 36 ++ include/linux/mm/high_memory.h | 7 + include/linux/mm/page_address.h | 71 +++ include/linux/mm/page_kasan_tag.h | 66 ++ include/linux/mm/page_section.h | 23 + include/linux/mm/pfmemalloc.h | 52 ++ include/linux/mm/vmalloc_addr.h | 33 + include/linux/nvme-keyring.h | 2 + include/linux/scatterlist.h | 8 +- include/linux/skbuff.h | 4 + kernel/dma/ops_helpers.c | 1 + kernel/dma/remap.c | 1 + lib/scatterlist.c | 1 + mm/dmapool.c | 1 + 66 files changed, 780 insertions(+), 576 deletions(-) create mode 100644 include/linux/mm/devmap_managed.h create mode 100644 include/linux/mm/folio_next.h create mode 100644 include/linux/mm/folio_size.h create mode 100644 include/linux/mm/folio_usage.h create mode 100644 include/linux/mm/folio_zone.h create mode 100644 include/linux/mm/high_memory.h create mode 100644 include/linux/mm/page_address.h create mode 100644 include/linux/mm/page_kasan_tag.h create mode 100644 include/linux/mm/page_section.h create mode 100644 include/linux/mm/pfmemalloc.h create mode 100644 include/linux/mm/vmalloc_addr.h