From patchwork Tue Mar 12 09:41:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kellermann X-Patchwork-Id: 13589713 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 211B6C54E66 for ; Tue, 12 Mar 2024 09:41:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A81C68D0026; Tue, 12 Mar 2024 05:41:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A31C48D000D; Tue, 12 Mar 2024 05:41:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8ABC58D0026; Tue, 12 Mar 2024 05:41:51 -0400 (EDT) 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 7BA948D000D for ; Tue, 12 Mar 2024 05:41:51 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 3235EA11FA for ; Tue, 12 Mar 2024 09:41:51 +0000 (UTC) X-FDA: 81887895222.09.64CE4D2 Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) by imf16.hostedemail.com (Postfix) with ESMTP id 29FEE180010 for ; Tue, 12 Mar 2024 09:41:48 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=ionos.com header.s=google header.b=HCPaL4Lx; spf=pass (imf16.hostedemail.com: domain of max.kellermann@ionos.com designates 209.85.208.48 as permitted sender) smtp.mailfrom=max.kellermann@ionos.com; dmarc=pass (policy=quarantine) header.from=ionos.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1710236509; 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=WdTMuNhLdde4/npesOLEbN40iQG/MGbfim/kxJH6up0=; b=fOuT1XhVu9FbjbkZ3Gi6UDl4zaiPxVf42i+xCb5l2jEGvdA8ugiAzPRrSUI15i2DRWdAYZ RJBB3SRYRZmcFvnSIEbxYL5beYR7jBg95I9OYHXogltydI8swdyx8e5E8F+MifkZQ9OO23 +LMqG5WsTIxj35TeiSWr+kjSRtb6TOs= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=ionos.com header.s=google header.b=HCPaL4Lx; spf=pass (imf16.hostedemail.com: domain of max.kellermann@ionos.com designates 209.85.208.48 as permitted sender) smtp.mailfrom=max.kellermann@ionos.com; dmarc=pass (policy=quarantine) header.from=ionos.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1710236509; a=rsa-sha256; cv=none; b=BL63CTdHwQ7vt0NqX7veZSSJxRaYh5mkeU4Kr2HvXKO1vaInbAHXd5iqKFD0p6OAJH/Akf Ex9vxGHDH6Xd5UV0phJOs61JgTEW2Y13UxopXZd+CIm8BxUBpANkCRu02FDRZOL8w9Q+dW r9UAreOjtfGgNKnV8jV1sKwPup+WXWQ= Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-5683247fd0fso5529897a12.3 for ; Tue, 12 Mar 2024 02:41:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1710236507; x=1710841307; 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=WdTMuNhLdde4/npesOLEbN40iQG/MGbfim/kxJH6up0=; b=HCPaL4LxR9eF4bJr2CS0C17oMYA0hmYuDaDFhImxhI+YTh5xeWosJ6KIe2vBrYG4hR YVxfL0KwfrRu/2QlLYPNxV/7We02dAUNRpTuvG0tzhZvbMYJjqcOdM7cg9UAbt21dyT4 8N3FjTBDqMe/n1SGnD7rj5wtFWOALNtOyRUHxh+MSgHE/YAl6JZJ9TfITfZKCxpJhcL9 k6skHvrqnl/UG0dqaHAzqVldmqqrfmPukKiInGu7QIIh9akEU3nW4G4cH1pGN5U2BrIP YZBTGumltD+9RqrQwidpetueNWuZe/m97DPQWibcZpZCPs3dD06ANSofcoOtyCgBBY03 EL8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710236507; x=1710841307; 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=WdTMuNhLdde4/npesOLEbN40iQG/MGbfim/kxJH6up0=; b=py7E2yWP9VxR9EixM+zpHdJnQzfAxctpjXnt3XzUeWMzoAoITi/k/rpAFVpUWgxd0I F/ofYS+YDrz6TXCcPKxRuMIQRXiyM1y3gvyCch3ey9y43H4pxrlRWY6VLmMvLcZvy9il zjKLsdATxT7Kr9tUCg9UQRNWpV4BD4YWvW1QWiwxucqBp7iSdspEqoSMCeHx+bOuGxZk Mqoi+SIdkhEFd7fn3mqEBqfHMd6ApJIu96+yXkeAhE4bbgVU6si2xpaeVbvv3vPlu2fs 4F2j/a7EEOTwQ6I4QqU9omGi0FxJVROoXqhGvmEZBOcS4ZD7Kne27rAYDZDlddXzNV/+ p06w== X-Forwarded-Encrypted: i=1; AJvYcCXWSb5kml5AN0PSJEQWzuVVq+ThE4ilgC6Q7PojVcMvtXnBmcUn4WsW5T1IaPTCZI2A0iGw+alxLhIhB2xciex4gTQ= X-Gm-Message-State: AOJu0YxcL++h9CQITi9FnlYzGzSNcmjF/G3igf9EHha1yS/f2VRvJonr G6jUKAUvecVc+INudMao0IYGz12cxQIBDjaqEItO9XxEVB34ZPuU6gH9EsY7Bc8= X-Google-Smtp-Source: AGHT+IGOAEcWgZfewOMBEQgq8gRG+1oEzNtwe7LDKMEfIaGe06nxshuW2ViBYXTYiAwkd4CGrT+ceQ== X-Received: by 2002:a17:906:a298:b0:a44:763:4dd3 with SMTP id i24-20020a170906a29800b00a4407634dd3mr5764667ejz.27.1710236507685; Tue, 12 Mar 2024 02:41:47 -0700 (PDT) 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 jw22-20020a170906e95600b00a4623030893sm2091961ejb.126.2024.03.12.02.41.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 02:41:47 -0700 (PDT) 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 v4 00/15] Fast kernel headers: split linux/mm.h Date: Tue, 12 Mar 2024 10:41:18 +0100 Message-Id: <20240312094133.2084996-1-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Rspamd-Queue-Id: 29FEE180010 X-Rspam-User: X-Stat-Signature: xqfu4enc999ymscpw6wwn9fc3mgf43c8 X-Rspamd-Server: rspam01 X-HE-Tag: 1710236508-30255 X-HE-Meta: U2FsdGVkX194iFoHc8RxAIYnbNBSWHWZipfuvZmplAHjg51eHqPeXBbhrAX9Qv2Vw5FqSxDJymLL4ux9bB+hDpLImcDYWY07EYzUODzptcVNVXz+PFl/NdeUc1wpzSulYwq1KJ0XTcpbPolpvWSoO1rMyq2ds0pcTyZEdW48v70stmGW3p01aQCBGqWHbgPF/g/4Uqb0BM+Lg4IF1Y9H24PUdVyjZHJKED6WDAVyjNR0jXhAwrRC8Yqd3/j55ysDU/laOz29QxtqE5Ldra6cE6xi9mIjbG/tSE8PsP/aowRrg9MIPALq3bWjpBNJ5X73zDkJJprFDKrivc//XOmCppLFYZzrwcErqv25GgO96DWlDtGENZlWw6y/MndfJwjGhkrIav7mDzcOESbcNrQOwRn9ulr8/UJBnjzi8xBBV7wFfrp97dAfoxF/Jo7lPUFNN/1dro4lHEv3vvYy6T2XG+jKTDKlU8YpTpRr+cEhygDEeqUU4D8Na2el+7GKWhkyo4fhdVfbnKlJsL971DFlrAUClUrQqc6pIWbfff7mquJooBVvSZ0Zf8817GMs781y/UoSkoPT0HTHv6sJqpRI/Sz9pqawJDKVdj6z8TJZ4kCQwTmH1lyF1PESQ5v3BzNXUMv3s7EqdmmCzWVp83zKjECQBAlg3qas8cDMJZT3mq1zwkqVBMB8QED/lBmPsWNTYo14FgOCSxVjnO+bN7bopUbNk/fUfhoM3AuMSkV1ugz+7SmTMZQANH5eRHgBRohJokw45XeEiwTSqtgPGzFqNBrSkP/Hl/QOvoIZcpzh8wP/XeGeUpSIBKnlDozMl7Tt+KH89iE+LITdi3tq/jnKJMjbwkoBZ9IWdMcBFcb/ERGnnLmC7/thMrQBQATah0ivuJuNysnbx9Wd3uZhq+oFczwv9sRalFpRI5YZRimqfFgKpxWXni0HBBuM9sDZyIanzidx+DmHRMtaZuLspIF pgWpPtRL 8QSP7liEXh/mpF/Rjuv0YmpL/H7TJOmNopk9S4QOEOEcHxsl3Pq5b8fBh16Nd/eXU6+4VGBLkBcV5rD88l1MHwlXr8tSH/WusJvbBgn44yS0b2jaiFVJGYu37M5p/EmVPHAPbRlgQ2XC9CvX62xMLBQFUYCFyv8UhZOxlsIRx2P9pooISC5UcpN/Z53nn3DSVTAtTI81bCxr3mZVnHbx+p9zldpcYoe/mPGD07ILjVDPRoO7ZLtTmnPVruV9aP5ZcK9suYsWA6hadIH8vMtncK46XfK55MBA8fqzxZScE6ynB44ea6iJfvuLTyib2lvh7QPoSyFdn8wdT3oc= 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 v3 -> v4: rebase on linux-next; fix build failure on loongarch64 (reported by kernel test robot); add missing includes to drivers/dma/bcm2835-dma.c and include/scsi/scsicam.h Max Kellermann (15): drivers: add missing includes on linux/mm.h (and others) include/drm/drm_gem.h: add poll_table_struct forward declaration include/scsi/scsicam.h: forward-declare struct block_device 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/bcm2835-dma.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/page-flags.h | 3 + include/linux/scatterlist.h | 8 +- include/linux/skbuff.h | 4 + include/scsi/scsicam.h | 5 + kernel/dma/ops_helpers.c | 1 + kernel/dma/remap.c | 1 + lib/scatterlist.c | 1 + mm/dmapool.c | 1 + 69 files changed, 789 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