61307b7b | 19-May-2024 |
Linus Torvalds <torvalds@linux-foundation.org> |
Merge tag 'mm-stable-2024-05-17-19-19' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull mm updates from Andrew Morton: "The usual shower of singleton fixes and minor series all over MM
Merge tag 'mm-stable-2024-05-17-19-19' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull mm updates from Andrew Morton: "The usual shower of singleton fixes and minor series all over MM, documented (hopefully adequately) in the respective changelogs. Notable series include:
- Lucas Stach has provided some page-mapping cleanup/consolidation/ maintainability work in the series "mm/treewide: Remove pXd_huge() API".
- In the series "Allow migrate on protnone reference with MPOL_PREFERRED_MANY policy", Donet Tom has optimized mempolicy's MPOL_PREFERRED_MANY mode, yielding almost doubled performance in one test.
- In their series "Memory allocation profiling" Kent Overstreet and Suren Baghdasaryan have contributed a means of determining (via /proc/allocinfo) whereabouts in the kernel memory is being allocated: number of calls and amount of memory.
- Matthew Wilcox has provided the series "Various significant MM patches" which does a number of rather unrelated things, but in largely similar code sites.
- In his series "mm: page_alloc: freelist migratetype hygiene" Johannes Weiner has fixed the page allocator's handling of migratetype requests, with resulting improvements in compaction efficiency.
- In the series "make the hugetlb migration strategy consistent" Baolin Wang has fixed a hugetlb migration issue, which should improve hugetlb allocation reliability.
- Liu Shixin has hit an I/O meltdown caused by readahead in a memory-tight memcg. Addressed in the series "Fix I/O high when memory almost met memcg limit".
- In the series "mm/filemap: optimize folio adding and splitting" Kairui Song has optimized pagecache insertion, yielding ~10% performance improvement in one test.
- Baoquan He has cleaned up and consolidated the early zone initialization code in the series "mm/mm_init.c: refactor free_area_init_core()".
- Baoquan has also redone some MM initializatio code in the series "mm/init: minor clean up and improvement".
- MM helper cleanups from Christoph Hellwig in his series "remove follow_pfn".
- More cleanups from Matthew Wilcox in the series "Various page->flags cleanups".
- Vlastimil Babka has contributed maintainability improvements in the series "memcg_kmem hooks refactoring".
- More folio conversions and cleanups in Matthew Wilcox's series: "Convert huge_zero_page to huge_zero_folio" "khugepaged folio conversions" "Remove page_idle and page_young wrappers" "Use folio APIs in procfs" "Clean up __folio_put()" "Some cleanups for memory-failure" "Remove page_mapping()" "More folio compat code removal"
- David Hildenbrand chipped in with "fs/proc/task_mmu: convert hugetlb functions to work on folis".
- Code consolidation and cleanup work related to GUP's handling of hugetlbs in Peter Xu's series "mm/gup: Unify hugetlb, part 2".
- Rick Edgecombe has developed some fixes to stack guard gaps in the series "Cover a guard gap corner case".
- Jinjiang Tu has fixed KSM's behaviour after a fork+exec in the series "mm/ksm: fix ksm exec support for prctl".
- Baolin Wang has implemented NUMA balancing for multi-size THPs. This is a simple first-cut implementation for now. The series is "support multi-size THP numa balancing".
- Cleanups to vma handling helper functions from Matthew Wilcox in the series "Unify vma_address and vma_pgoff_address".
- Some selftests maintenance work from Dev Jain in the series "selftests/mm: mremap_test: Optimizations and style fixes".
- Improvements to the swapping of multi-size THPs from Ryan Roberts in the series "Swap-out mTHP without splitting".
- Kefeng Wang has significantly optimized the handling of arm64's permission page faults in the series "arch/mm/fault: accelerate pagefault when badaccess" "mm: remove arch's private VM_FAULT_BADMAP/BADACCESS"
- GUP cleanups from David Hildenbrand in "mm/gup: consistently call it GUP-fast".
- hugetlb fault code cleanups from Vishal Moola in "Hugetlb fault path to use struct vm_fault".
- selftests build fixes from John Hubbard in the series "Fix selftests/mm build without requiring "make headers"".
- Memory tiering fixes/improvements from Ho-Ren (Jack) Chuang in the series "Improved Memory Tier Creation for CPUless NUMA Nodes". Fixes the initialization code so that migration between different memory types works as intended.
- David Hildenbrand has improved follow_pte() and fixed an errant driver in the series "mm: follow_pte() improvements and acrn follow_pte() fixes".
- David also did some cleanup work on large folio mapcounts in his series "mm: mapcount for large folios + page_mapcount() cleanups".
- Folio conversions in KSM in Alex Shi's series "transfer page to folio in KSM".
- Barry Song has added some sysfs stats for monitoring multi-size THP's in the series "mm: add per-order mTHP alloc and swpout counters".
- Some zswap cleanups from Yosry Ahmed in the series "zswap same-filled and limit checking cleanups".
- Matthew Wilcox has been looking at buffer_head code and found the documentation to be lacking. The series is "Improve buffer head documentation".
- Multi-size THPs get more work, this time from Lance Yang. His series "mm/madvise: enhance lazyfreeing with mTHP in madvise_free" optimizes the freeing of these things.
- Kemeng Shi has added more userspace-visible writeback instrumentation in the series "Improve visibility of writeback".
- Kemeng Shi then sent some maintenance work on top in the series "Fix and cleanups to page-writeback".
- Matthew Wilcox reduces mmap_lock traffic in the anon vma code in the series "Improve anon_vma scalability for anon VMAs". Intel's test bot reported an improbable 3x improvement in one test.
- SeongJae Park adds some DAMON feature work in the series "mm/damon: add a DAMOS filter type for page granularity access recheck" "selftests/damon: add DAMOS quota goal test"
- Also some maintenance work in the series "mm/damon/paddr: simplify page level access re-check for pageout" "mm/damon: misc fixes and improvements"
- David Hildenbrand has disabled some known-to-fail selftests ni the series "selftests: mm: cow: flag vmsplice() hugetlb tests as XFAIL".
- memcg metadata storage optimizations from Shakeel Butt in "memcg: reduce memory consumption by memcg stats".
- DAX fixes and maintenance work from Vishal Verma in the series "dax/bus.c: Fixups for dax-bus locking""
* tag 'mm-stable-2024-05-17-19-19' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (426 commits) memcg, oom: cleanup unused memcg_oom_gfp_mask and memcg_oom_order selftests/mm: hugetlb_madv_vs_map: avoid test skipping by querying hugepage size at runtime mm/hugetlb: add missing VM_FAULT_SET_HINDEX in hugetlb_wp mm/hugetlb: add missing VM_FAULT_SET_HINDEX in hugetlb_fault selftests: cgroup: add tests to verify the zswap writeback path mm: memcg: make alloc_mem_cgroup_per_node_info() return bool mm/damon/core: fix return value from damos_wmark_metric_value mm: do not update memcg stats for NR_{FILE/SHMEM}_PMDMAPPED selftests: cgroup: remove redundant enabling of memory controller Docs/mm/damon/maintainer-profile: allow posting patches based on damon/next tree Docs/mm/damon/maintainer-profile: change the maintainer's timezone from PST to PT Docs/mm/damon/design: use a list for supported filters Docs/admin-guide/mm/damon/usage: fix wrong schemes effective quota update command Docs/admin-guide/mm/damon/usage: fix wrong example of DAMOS filter matching sysfs file selftests/damon: classify tests for functionalities and regressions selftests/damon/_damon_sysfs: use 'is' instead of '==' for 'None' selftests/damon/_damon_sysfs: find sysfs mount point from /proc/mounts selftests/damon/_damon_sysfs: check errors from nr_schemes file reads mm/damon/core: initialize ->esz_bp from damos_quota_init_priv() selftests/damon: add a test for DAMOS quota goal ...
show more ...
/linux/Documentation/ABI/testing/sysfs-kernel-mm-damon/linux/Documentation/ABI/testing/sysfs-kernel-mm-transparent-hugepage/linux/Documentation/admin-guide/blockdev/zram.rst/linux/Documentation/admin-guide/cgroup-v1/memory.rst/linux/Documentation/admin-guide/kernel-parameters.txt/linux/Documentation/admin-guide/mm/damon/usage.rst/linux/Documentation/admin-guide/mm/hugetlbpage.rst/linux/Documentation/admin-guide/mm/transhuge.rst/linux/Documentation/admin-guide/mm/zswap.rst/linux/Documentation/admin-guide/sysctl/vm.rst/linux/Documentation/devicetree/bindings/clock/airoha,en7523-scu.yaml/linux/Documentation/devicetree/bindings/clock/fixed-clock.yaml/linux/Documentation/devicetree/bindings/clock/fixed-factor-clock.yaml/linux/Documentation/devicetree/bindings/clock/loongson,ls2k-clk.yaml/linux/Documentation/devicetree/bindings/clock/nxp,imx95-blk-ctl.yaml/linux/Documentation/devicetree/bindings/clock/nxp,imx95-display-master-csr.yaml/linux/Documentation/devicetree/bindings/clock/qcom,hfpll.yaml/linux/Documentation/devicetree/bindings/clock/renesas,rzg2l-cpg.yaml/linux/Documentation/devicetree/bindings/clock/samsung,s3c6400-clock.yaml/linux/Documentation/devicetree/bindings/clock/sophgo,cv1800-clk.yaml/linux/Documentation/devicetree/bindings/clock/st,stm32mp25-rcc.yaml/linux/Documentation/devicetree/bindings/power/supply/maxim,max8903.yaml/linux/Documentation/driver-api/crypto/iaa/iaa-crypto.rst/linux/Documentation/filesystems/api-summary.rst/linux/Documentation/filesystems/buffer.rst/linux/Documentation/filesystems/index.rst/linux/Documentation/filesystems/proc.rst/linux/Documentation/mm/allocation-profiling.rst/linux/Documentation/mm/arch_pgtable_helpers.rst/linux/Documentation/mm/damon/design.rst/linux/Documentation/mm/damon/maintainer-profile.rst/linux/Documentation/mm/index.rst/linux/Documentation/mm/page_table_check.rst/linux/Documentation/mm/transhuge.rst/linux/Documentation/mm/vmemmap_dedup.rst/linux/Documentation/netlink/specs/nfsd.yaml/linux/Documentation/translations/zh_CN/core-api/cachetlb.rst/linux/MAINTAINERS/linux/arch/alpha/kernel/osf_sys.c/linux/arch/alpha/kernel/pci_iommu.c/linux/arch/alpha/lib/checksum.c/linux/arch/alpha/lib/fpreg.c/linux/arch/arc/include/asm/mmu-arcv2.h/linux/arch/arc/mm/mmap.c/linux/arch/arm/Kconfig/linux/arch/arm/include/asm/hugetlb.h/linux/arch/arm/include/asm/pgtable-2level.h/linux/arch/arm/include/asm/pgtable-3level-hwdef.h/linux/arch/arm/include/asm/pgtable-3level.h/linux/arch/arm/kernel/irq.c/linux/arch/arm/kernel/traps.c/linux/arch/arm/lib/uaccess_with_memcpy.c/linux/arch/arm/mm/Makefile/linux/arch/arm/mm/fault.c/linux/arch/arm/mm/mmap.c/linux/arch/arm64/Kconfig/linux/arch/arm64/include/asm/hugetlb.h/linux/arch/arm64/include/asm/io.h/linux/arch/arm64/include/asm/pgtable.h/linux/arch/arm64/kernel/efi.c/linux/arch/arm64/kernel/io.c/linux/arch/arm64/mm/contpte.c/linux/arch/arm64/mm/fault.c/linux/arch/arm64/mm/hugetlbpage.c/linux/arch/arm64/mm/mteswap.c/linux/arch/csky/abiv1/mmap.c/linux/arch/loongarch/Kconfig/linux/arch/loongarch/include/asm/kfence.h/linux/arch/loongarch/mm/hugetlbpage.c/linux/arch/loongarch/mm/mmap.c/linux/arch/mips/Kconfig/linux/arch/mips/include/asm/pgtable-32.h/linux/arch/mips/include/asm/pgtable-64.h/linux/arch/mips/jazz/jazzdma.c/linux/arch/mips/mm/hugetlbpage.c/linux/arch/mips/mm/mmap.c/linux/arch/mips/mm/tlb-r4k.c/linux/arch/parisc/kernel/sys_parisc.c/linux/arch/parisc/mm/hugetlbpage.c/linux/arch/powerpc/Kconfig/linux/arch/powerpc/include/asm/book3s/64/pgtable-4k.h/linux/arch/powerpc/include/asm/book3s/64/pgtable-64k.h/linux/arch/powerpc/include/asm/book3s/64/pgtable.h/linux/arch/powerpc/include/asm/mmu.h/linux/arch/powerpc/include/asm/nohash/pgtable.h/linux/arch/powerpc/kernel/dma-iommu.c/linux/arch/powerpc/kernel/fadump.c/linux/arch/powerpc/kernel/iommu.c/linux/arch/powerpc/mm/book3s64/pgtable.c/linux/arch/powerpc/mm/book3s64/slice.c/linux/arch/powerpc/mm/fault.c/linux/arch/powerpc/mm/mem.c/linux/arch/powerpc/mm/pgtable_64.c/linux/arch/powerpc/platforms/ps3/system-bus.c/linux/arch/powerpc/platforms/pseries/vio.c/linux/arch/riscv/Kconfig/linux/arch/riscv/include/asm/hugetlb.h/linux/arch/riscv/include/asm/pgtable.h/linux/arch/riscv/kernel/elf_kexec.c/linux/arch/riscv/kernel/probes/kprobes.c/linux/arch/riscv/mm/fault.c/linux/arch/riscv/mm/hugetlbpage.c/linux/arch/s390/Kconfig/linux/arch/s390/include/asm/hugetlb.h/linux/arch/s390/include/asm/io.h/linux/arch/s390/include/asm/pgtable.h/linux/arch/s390/kernel/cert_store.c/linux/arch/s390/kernel/ipl.c/linux/arch/s390/mm/fault.c/linux/arch/s390/mm/hugetlbpage.c/linux/arch/s390/mm/mmap.c/linux/arch/s390/pci/pci.c/linux/arch/s390/pci/pci_mmio.c/linux/arch/sh/Kconfig/linux/arch/sh/include/asm/hugetlb.h/linux/arch/sh/mm/cache-sh4.c/linux/arch/sh/mm/cache.c/linux/arch/sh/mm/hugetlbpage.c/linux/arch/sh/mm/mmap.c/linux/arch/sparc/include/asm/pgtable_64.h/linux/arch/sparc/kernel/sys_sparc_32.c/linux/arch/sparc/kernel/sys_sparc_64.c/linux/arch/sparc/mm/hugetlbpage.c/linux/arch/sparc/mm/tlb.c/linux/arch/um/include/shared/um_malloc.h/linux/arch/x86/Kconfig/linux/arch/x86/include/asm/io.h/linux/arch/x86/include/asm/pgtable.h/linux/arch/x86/include/asm/pgtable_64.h/linux/arch/x86/kernel/amd_gart_64.c/linux/arch/x86/kernel/cpu/sgx/driver.c/linux/arch/x86/kernel/cpu/sgx/main.c/linux/arch/x86/kernel/irq_64.c/linux/arch/x86/kernel/setup.c/linux/arch/x86/kernel/sys_x86_64.c/linux/arch/x86/lib/Makefile/linux/arch/x86/mm/fault.c/linux/arch/x86/mm/hugetlbpage.c/linux/arch/x86/mm/init.c/linux/arch/x86/mm/mmap.c/linux/arch/x86/mm/numa_32.c/linux/arch/x86/mm/pat/memtype.c/linux/arch/x86/mm/pgtable.c/linux/arch/xtensa/mm/cache.c/linux/arch/xtensa/mm/tlb.c/linux/drivers/accel/ivpu/ivpu_mmu_context.c/linux/drivers/block/zram/zram_drv.c/linux/drivers/char/mem.c/linux/drivers/clk/Kconfig/linux/drivers/clk/Makefile/linux/drivers/clk/bcm/clk-bcm2711-dvp.c/linux/drivers/clk/bcm/clk-raspberrypi.c/linux/drivers/clk/clk-en7523.c/linux/drivers/clk/clk-gemini.c/linux/drivers/clk/clk-highbank.c/linux/drivers/clk/clk-loongson2.c/linux/drivers/clk/clk-renesas-pcie.c/linux/drivers/clk/clk-scmi.c/linux/drivers/clk/imx/Kconfig/linux/drivers/clk/imx/Makefile/linux/drivers/clk/imx/clk-imx8mp-audiomix.c/linux/drivers/clk/imx/clk-imx95-blk-ctl.c/linux/drivers/clk/mediatek/clk-mt8365-mm.c/linux/drivers/clk/mediatek/clk-pllfh.c/linux/drivers/clk/meson/Kconfig/linux/drivers/clk/meson/Makefile/linux/drivers/clk/meson/a1-peripherals.c/linux/drivers/clk/meson/a1-pll.c/linux/drivers/clk/meson/axg-aoclk.c/linux/drivers/clk/meson/axg-audio.c/linux/drivers/clk/meson/axg.c/linux/drivers/clk/meson/clk-cpu-dyndiv.c/linux/drivers/clk/meson/clk-dualdiv.c/linux/drivers/clk/meson/clk-mpll.c/linux/drivers/clk/meson/clk-phase.c/linux/drivers/clk/meson/clk-pll.c/linux/drivers/clk/meson/clk-regmap.c/linux/drivers/clk/meson/g12a-aoclk.c/linux/drivers/clk/meson/g12a.c/linux/drivers/clk/meson/gxbb-aoclk.c/linux/drivers/clk/meson/gxbb.c/linux/drivers/clk/meson/meson-aoclk.c/linux/drivers/clk/meson/meson-eeclk.c/linux/drivers/clk/meson/s4-peripherals.c/linux/drivers/clk/meson/s4-pll.c/linux/drivers/clk/meson/sclk-div.c/linux/drivers/clk/meson/vclk.c/linux/drivers/clk/meson/vclk.h/linux/drivers/clk/meson/vid-pll-div.c/linux/drivers/clk/microchip/clk-mpfs.c/linux/drivers/clk/nxp/clk-lpc18xx-cgu.c/linux/drivers/clk/qcom/Kconfig/linux/drivers/clk/qcom/apss-ipq-pll.c/linux/drivers/clk/qcom/clk-alpha-pll.c/linux/drivers/clk/qcom/clk-alpha-pll.h/linux/drivers/clk/qcom/clk-cbf-8996.c/linux/drivers/clk/qcom/clk-rcg.h/linux/drivers/clk/qcom/clk-rcg2.c/linux/drivers/clk/qcom/clk-rpm.c/linux/drivers/clk/qcom/common.c/linux/drivers/clk/qcom/common.h/linux/drivers/clk/qcom/dispcc-sm6350.c/linux/drivers/clk/qcom/dispcc-sm8450.c/linux/drivers/clk/qcom/dispcc-sm8550.c/linux/drivers/clk/qcom/dispcc-sm8650.c/linux/drivers/clk/qcom/gcc-ipq8074.c/linux/drivers/clk/qcom/gcc-msm8917.c/linux/drivers/clk/qcom/gcc-msm8953.c/linux/drivers/clk/qcom/gcc-sm8150.c/linux/drivers/clk/qcom/hfpll.c/linux/drivers/clk/qcom/mmcc-msm8998.c/linux/drivers/clk/renesas/clk-r8a73a4.c/linux/drivers/clk/renesas/clk-r8a7740.c/linux/drivers/clk/renesas/clk-sh73a0.c/linux/drivers/clk/renesas/r8a779a0-cpg-mssr.c/linux/drivers/clk/renesas/r8a779h0-cpg-mssr.c/linux/drivers/clk/renesas/r9a07g043-cpg.c/linux/drivers/clk/renesas/r9a07g044-cpg.c/linux/drivers/clk/renesas/r9a08g045-cpg.c/linux/drivers/clk/renesas/rzg2l-cpg.c/linux/drivers/clk/renesas/rzg2l-cpg.h/linux/drivers/clk/rockchip/clk-mmc-phase.c/linux/drivers/clk/rockchip/clk-rk3568.c/linux/drivers/clk/rockchip/rst-rk3588.c/linux/drivers/clk/samsung/clk-exynos-arm64.c/linux/drivers/clk/samsung/clk-exynos850.c/linux/drivers/clk/samsung/clk-exynosautov9.c/linux/drivers/clk/samsung/clk-gs101.c/linux/drivers/clk/samsung/clk.c/linux/drivers/clk/samsung/clk.h/linux/drivers/clk/sophgo/Kconfig/linux/drivers/clk/sophgo/Makefile/linux/drivers/clk/sophgo/clk-cv1800.c/linux/drivers/clk/sophgo/clk-cv1800.h/linux/drivers/clk/sophgo/clk-cv18xx-common.c/linux/drivers/clk/sophgo/clk-cv18xx-common.h/linux/drivers/clk/sophgo/clk-cv18xx-ip.c/linux/drivers/clk/sophgo/clk-cv18xx-ip.h/linux/drivers/clk/sophgo/clk-cv18xx-pll.c/linux/drivers/clk/sophgo/clk-cv18xx-pll.h/linux/drivers/clk/stm32/Kconfig/linux/drivers/clk/stm32/Makefile/linux/drivers/clk/stm32/clk-stm32-core.c/linux/drivers/clk/stm32/clk-stm32mp13.c/linux/drivers/clk/stm32/clk-stm32mp25.c/linux/drivers/clk/stm32/reset-stm32.c/linux/drivers/clk/stm32/reset-stm32.h/linux/drivers/clk/stm32/stm32mp25_rcc.h/linux/drivers/clk/sunxi-ng/ccu-sun20i-d1-r.c/linux/drivers/clk/sunxi-ng/ccu-sun20i-d1.c/linux/drivers/clk/sunxi-ng/ccu-sun4i-a10.c/linux/drivers/clk/sunxi-ng/ccu-sun50i-a100-r.c/linux/drivers/clk/sunxi-ng/ccu-sun50i-a100.c/linux/drivers/clk/sunxi-ng/ccu-sun50i-a64.c/linux/drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c/linux/drivers/clk/sunxi-ng/ccu-sun50i-h6.c/linux/drivers/clk/sunxi-ng/ccu-sun50i-h616.c/linux/drivers/clk/sunxi-ng/ccu-sun6i-a31.c/linux/drivers/clk/sunxi-ng/ccu-sun6i-rtc.c/linux/drivers/clk/sunxi-ng/ccu-sun8i-a23.c/linux/drivers/clk/sunxi-ng/ccu-sun8i-a33.c/linux/drivers/clk/sunxi-ng/ccu-sun8i-a83t.c/linux/drivers/clk/sunxi-ng/ccu-sun8i-de2.c/linux/drivers/clk/sunxi-ng/ccu-sun8i-h3.c/linux/drivers/clk/sunxi-ng/ccu-sun8i-r.c/linux/drivers/clk/sunxi-ng/ccu-sun8i-r40.c/linux/drivers/clk/sunxi-ng/ccu-sun8i-v3s.c/linux/drivers/clk/sunxi-ng/ccu-sun9i-a80-de.c/linux/drivers/clk/sunxi-ng/ccu-sun9i-a80-usb.c/linux/drivers/clk/sunxi-ng/ccu-sun9i-a80.c/linux/drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c/linux/drivers/clk/sunxi-ng/ccu_nkm.c/linux/drivers/clk/sunxi-ng/ccu_nkm.h/linux/drivers/clk/ti/dpll.c/linux/drivers/dax/bus.c/linux/drivers/dax/device.c/linux/drivers/dax/kmem.c/linux/drivers/gpu/drm/gma500/mmu.c/linux/drivers/gpu/drm/i915/gem/i915_gem_pages.c/linux/drivers/gpu/drm/i915/gem/selftests/mock_dmabuf.c/linux/drivers/gpu/drm/i915/gt/shmem_utils.c/linux/drivers/gpu/drm/i915/gvt/firmware.c/linux/drivers/gpu/drm/i915/gvt/gtt.c/linux/drivers/gpu/drm/i915/gvt/handlers.c/linux/drivers/gpu/drm/i915/gvt/mmio.c/linux/drivers/gpu/drm/i915/gvt/vgpu.c/linux/drivers/gpu/drm/i915/intel_gvt.c/linux/drivers/gpu/drm/imagination/pvr_vm_mips.c/linux/drivers/gpu/drm/mediatek/mtk_gem.c/linux/drivers/gpu/drm/omapdrm/omap_gem.c/linux/drivers/gpu/drm/v3d/v3d_bo.c/linux/drivers/gpu/drm/vmwgfx/vmwgfx_binding.c/linux/drivers/gpu/drm/vmwgfx/vmwgfx_cmd.c/linux/drivers/gpu/drm/vmwgfx/vmwgfx_devcaps.c/linux/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c/linux/drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c/linux/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c/linux/drivers/gpu/drm/xen/xen_drm_front_gem.c/linux/drivers/hsi/controllers/omap_ssi_core.c/linux/drivers/hsi/controllers/omap_ssi_port.c/linux/drivers/hwtracing/coresight/coresight-trbe.c/linux/drivers/infiniband/core/cma.c/linux/drivers/infiniband/core/device.c/linux/drivers/infiniband/core/lag.c/linux/drivers/infiniband/core/nldev.c/linux/drivers/infiniband/core/restrack.c/linux/drivers/infiniband/core/roce_gid_mgmt.c/linux/drivers/infiniband/core/user_mad.c/linux/drivers/infiniband/hw/bnxt_re/qplib_fp.c/linux/drivers/infiniband/hw/efa/efa_admin_cmds_defs.h/linux/drivers/infiniband/hw/efa/efa_com_cmd.c/linux/drivers/infiniband/hw/efa/efa_com_cmd.h/linux/drivers/infiniband/hw/efa/efa_main.c/linux/drivers/infiniband/hw/efa/efa_verbs.c/linux/drivers/infiniband/hw/erdma/erdma.h/linux/drivers/infiniband/hw/erdma/erdma_cmdq.c/linux/drivers/infiniband/hw/erdma/erdma_cq.c/linux/drivers/infiniband/hw/erdma/erdma_eq.c/linux/drivers/infiniband/hw/erdma/erdma_hw.h/linux/drivers/infiniband/hw/erdma/erdma_main.c/linux/drivers/infiniband/hw/erdma/erdma_qp.c/linux/drivers/infiniband/hw/erdma/erdma_verbs.c/linux/drivers/infiniband/hw/erdma/erdma_verbs.h/linux/drivers/infiniband/hw/hfi1/ipoib_main.c/linux/drivers/infiniband/hw/hfi1/pcie.c/linux/drivers/infiniband/hw/hns/hns_roce_ah.c/linux/drivers/infiniband/hw/hns/hns_roce_alloc.c/linux/drivers/infiniband/hw/hns/hns_roce_cq.c/linux/drivers/infiniband/hw/hns/hns_roce_device.h/linux/drivers/infiniband/hw/hns/hns_roce_hem.c/linux/drivers/infiniband/hw/hns/hns_roce_hem.h/linux/drivers/infiniband/hw/hns/hns_roce_hw_v2.c/linux/drivers/infiniband/hw/hns/hns_roce_hw_v2.h/linux/drivers/infiniband/hw/hns/hns_roce_main.c/linux/drivers/infiniband/hw/hns/hns_roce_mr.c/linux/drivers/infiniband/hw/hns/hns_roce_qp.c/linux/drivers/infiniband/hw/hns/hns_roce_srq.c/linux/drivers/infiniband/hw/mana/cq.c/linux/drivers/infiniband/hw/mana/device.c/linux/drivers/infiniband/hw/mana/main.c/linux/drivers/infiniband/hw/mana/mana_ib.h/linux/drivers/infiniband/hw/mana/mr.c/linux/drivers/infiniband/hw/mana/qp.c/linux/drivers/infiniband/hw/mana/wq.c/linux/drivers/infiniband/hw/mlx5/main.c/linux/drivers/infiniband/hw/mlx5/mem.c/linux/drivers/infiniband/hw/mlx5/mlx5_ib.h/linux/drivers/infiniband/hw/mlx5/mr.c/linux/drivers/infiniband/hw/mlx5/qp.c/linux/drivers/infiniband/hw/mlx5/restrack.c/linux/drivers/infiniband/sw/rxe/rxe_comp.c/linux/drivers/infiniband/sw/rxe/rxe_hw_counters.c/linux/drivers/infiniband/sw/rxe/rxe_hw_counters.h/linux/drivers/infiniband/sw/rxe/rxe_loc.h/linux/drivers/infiniband/sw/rxe/rxe_net.c/linux/drivers/infiniband/sw/rxe/rxe_pool.c/linux/drivers/infiniband/sw/rxe/rxe_qp.c/linux/drivers/infiniband/sw/rxe/rxe_req.c/linux/drivers/infiniband/sw/rxe/rxe_resp.c/linux/drivers/infiniband/sw/rxe/rxe_verbs.c/linux/drivers/infiniband/sw/rxe/rxe_verbs.h/linux/drivers/infiniband/ulp/ipoib/ipoib_main.c/linux/drivers/infiniband/ulp/ipoib/ipoib_vlan.c/linux/drivers/iommu/dma-iommu.c/linux/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c/linux/drivers/net/ethernet/marvell/octeon_ep/octep_pfvf_mbox.c/linux/drivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_mbox.c/linux/drivers/net/ethernet/microsoft/mana/hw_channel.c/linux/drivers/parisc/ccio-dma.c/linux/drivers/parisc/sba_iommu.c/linux/drivers/platform/x86/uv_sysfs.c/linux/drivers/power/supply/bq27xxx_battery.c/linux/drivers/power/supply/cros_peripheral_charger.c/linux/drivers/power/supply/cros_usbpd-charger.c/linux/drivers/power/supply/power_supply_sysfs.c/linux/drivers/power/supply/test_power.c/linux/drivers/reset/reset-mpfs.c/linux/drivers/scsi/mpi3mr/mpi3mr_transport.c/linux/drivers/staging/media/atomisp/pci/hmm/hmm.c/linux/drivers/vfio/pci/pds/dirty.c/linux/drivers/vfio/vfio_iommu_type1.c/linux/drivers/virt/acrn/mm.c/linux/drivers/virtio/virtio_mem.c/linux/drivers/xen/grant-dma-ops.c/linux/drivers/xen/swiotlb-xen.c/linux/fs/buffer.c/linux/fs/crypto/inline_crypt.c/linux/fs/dax.c/linux/fs/exec.c/linux/fs/ext4/acl.h/linux/fs/ext4/ext4.h/linux/fs/ext4/extents.c/linux/fs/ext4/file.c/linux/fs/ext4/inode.c/linux/fs/ext4/ioctl.c/linux/fs/ext4/mballoc-test.c/linux/fs/ext4/mballoc.c/linux/fs/ext4/mballoc.h/linux/fs/ext4/move_extent.c/linux/fs/ext4/namei.c/linux/fs/ext4/page-io.c/linux/fs/ext4/readpage.c/linux/fs/ext4/super.c/linux/fs/ext4/sysfs.c/linux/fs/ext4/xattr.c/linux/fs/f2fs/data.c/linux/fs/hugetlbfs/inode.c/linux/fs/jbd2/checkpoint.c/linux/fs/jbd2/commit.c/linux/fs/lockd/host.c/linux/fs/nfs/iostat.h/linux/fs/nfsd/export.c/linux/fs/nfsd/netlink.c/linux/fs/nfsd/netlink.h/linux/fs/nfsd/netns.h/linux/fs/nfsd/nfs4callback.c/linux/fs/nfsd/nfs4proc.c/linux/fs/nfsd/nfs4state.c/linux/fs/nfsd/nfs4xdr.c/linux/fs/nfsd/nfsctl.c/linux/fs/nfsd/nfsd.h/linux/fs/nfsd/nfsfh.c/linux/fs/nfsd/nfssvc.c/linux/fs/nfsd/state.h/linux/fs/nfsd/stats.c/linux/fs/nfsd/stats.h/linux/fs/nfsd/trace.h/linux/fs/nfsd/vfs.c/linux/fs/nfsd/vfs.h/linux/fs/nfsd/xdr4.h/linux/fs/proc/inode.c/linux/fs/proc/meminfo.c/linux/fs/proc/page.c/linux/fs/proc/task_mmu.c/linux/fs/ramfs/file-mmu.c/linux/fs/smb/client/inode.c/linux/fs/userfaultfd.c/linux/include/acpi/platform/aclinuxex.h/linux/include/asm-generic/codetag.lds.h/linux/include/asm-generic/io.h/linux/include/asm-generic/pgalloc.h/linux/include/asm-generic/vmlinux.lds.h/linux/include/crypto/hash.h/linux/include/crypto/internal/acompress.h/linux/include/crypto/skcipher.h/linux/include/dt-bindings/clock/loongson,ls2k-clk.h/linux/include/dt-bindings/clock/nxp,imx95-clock.h/linux/include/dt-bindings/clock/r9a07g043-cpg.h/linux/include/dt-bindings/clock/r9a07g044-cpg.h/linux/include/dt-bindings/clock/r9a07g054-cpg.h/linux/include/dt-bindings/clock/r9a08g045-cpg.h/linux/include/dt-bindings/clock/rk3568-cru.h/linux/include/dt-bindings/reset/rockchip,rk3588-cru.h/linux/include/dt-bindings/reset/st,stm32mp25-rcc.h/linux/include/linux/alloc_tag.h/linux/include/linux/bpf.h/linux/include/linux/bpfptr.h/linux/include/linux/buffer_head.h/linux/include/linux/codetag.h/linux/include/linux/damon.h/linux/include/linux/dma-fence-chain.h/linux/include/linux/dma-map-ops.h/linux/include/linux/fortify-string.h/linux/include/linux/fs.h/linux/include/linux/gfp.h/linux/include/linux/gfp_types.h/linux/include/linux/hid_bpf.h/linux/include/linux/huge_mm.h/linux/include/linux/hugetlb.h/linux/include/linux/io.h/linux/include/linux/jbd2.h/linux/include/linux/ksm.h/linux/include/linux/memcontrol.h/linux/include/linux/memory-tiers.h/linux/include/linux/mempolicy.h/linux/include/linux/mempool.h/linux/include/linux/mm.h/linux/include/linux/mm_types.h/linux/include/linux/mmap_lock.h/linux/include/linux/nfs4.h/linux/include/linux/page-flags.h/linux/include/linux/page-isolation.h/linux/include/linux/page_ext.h/linux/include/linux/page_idle.h/linux/include/linux/page_ref.h/linux/include/linux/pageblock-flags.h/linux/include/linux/pagemap.h/linux/include/linux/pds/pds_common.h/linux/include/linux/percpu.h/linux/include/linux/pgalloc_tag.h/linux/include/linux/pgtable.h/linux/include/linux/power/bq27xxx_battery.h/linux/include/linux/ptr_ring.h/linux/include/linux/rhashtable-types.h/linux/include/linux/rmap.h/linux/include/linux/sched.h/linux/include/linux/sched/coredump.h/linux/include/linux/sched/mm.h/linux/include/linux/secretmem.h/linux/include/linux/skb_array.h/linux/include/linux/skbuff.h/linux/include/linux/skmsg.h/linux/include/linux/slab.h/linux/include/linux/sockptr.h/linux/include/linux/string.h/linux/include/linux/sunrpc/svc_xprt.h/linux/include/linux/swap.h/linux/include/linux/vmalloc.h/linux/include/linux/vmstat.h/linux/include/linux/writeback.h/linux/include/linux/xarray.h/linux/include/linux/zpool.h/linux/include/linux/zswap.h/linux/include/net/netlabel.h/linux/include/net/netlink.h/linux/include/net/request_sock.h/linux/include/net/tcx.h/linux/include/rdma/rdmavt_qp.h/linux/include/rdma/restrack.h/linux/include/soc/microchip/mpfs.h/linux/include/trace/events/fs_dax.h/linux/include/trace/events/huge_memory.h/linux/include/trace/events/mmflags.h/linux/include/trace/events/page_ref.h/linux/include/trace/misc/nfs.h/linux/include/uapi/linux/nfs.h/linux/include/uapi/linux/nfsd_netlink.h/linux/include/uapi/rdma/efa-abi.h/linux/include/uapi/rdma/hns-abi.h/linux/include/uapi/rdma/mana-abi.h/linux/include/uapi/rdma/rdma_netlink.h/linux/init/Kconfig/linux/io_uring/memmap.c/linux/kernel/bpf/arena.c/linux/kernel/bpf/memalloc.c/linux/kernel/bpf/syscall.c/linux/kernel/dma/mapping.c/linux/kernel/events/core.c/linux/kernel/fork.c/linux/kernel/kallsyms_selftest.c/linux/kernel/module/main.c/linux/kernel/vmcore_info.c/linux/lib/Kconfig.debug/linux/lib/Makefile/linux/lib/alloc_tag.c/linux/lib/codetag.c/linux/lib/iomap_copy.c/linux/lib/rhashtable.c/linux/lib/test_hmm.c/linux/lib/test_xarray.c/linux/lib/xarray.c/linux/mm/Kconfig/linux/mm/Makefile/linux/mm/backing-dev.c/linux/mm/cma.c/linux/mm/compaction.c/linux/mm/damon/core.c/linux/mm/damon/paddr.c/linux/mm/damon/sysfs-schemes.c/linux/mm/debug.c/linux/mm/debug_page_alloc.c/linux/mm/debug_vm_pgtable.c/linux/mm/filemap.c/linux/mm/folio-compat.c/linux/mm/gup.c/linux/mm/hmm.c/linux/mm/huge_memory.c/linux/mm/hugetlb.c/linux/mm/hugetlb_cgroup.c/linux/mm/hugetlb_vmemmap.c/linux/mm/hwpoison-inject.c/linux/mm/internal.h/linux/mm/kasan/hw_tags.c/linux/mm/kfence/core.c/linux/mm/kfence/kfence.h/linux/mm/khugepaged.c/linux/mm/kmemleak.c/linux/mm/ksm.c/linux/mm/madvise.c/linux/mm/memcontrol.c/linux/mm/memory-failure.c/linux/mm/memory-tiers.c/linux/mm/memory.c/linux/mm/memory_hotplug.c/linux/mm/mempolicy.c/linux/mm/mempool.c/linux/mm/memremap.c/linux/mm/migrate.c/linux/mm/migrate_device.c/linux/mm/mlock.c/linux/mm/mm_init.c/linux/mm/mmap.c/linux/mm/mprotect.c/linux/mm/mremap.c/linux/mm/nommu.c/linux/mm/oom_kill.c/linux/mm/page-writeback.c/linux/mm/page_alloc.c/linux/mm/page_ext.c/linux/mm/page_io.c/linux/mm/page_isolation.c/linux/mm/page_owner.c/linux/mm/page_table_check.c/linux/mm/page_vma_mapped.c/linux/mm/percpu-internal.h/linux/mm/percpu-vm.c/linux/mm/percpu.c/linux/mm/pgtable-generic.c/linux/mm/readahead.c/linux/mm/rmap.c/linux/mm/shmem.c/linux/mm/show_mem.c/linux/mm/slab.h/linux/mm/slab_common.c/linux/mm/slub.c/linux/mm/sparse.c/linux/mm/swap.c/linux/mm/swap_slots.c/linux/mm/swap_state.c/linux/mm/swapfile.c/linux/mm/truncate.c/linux/mm/userfaultfd.c/linux/mm/util.c/linux/mm/vmalloc.c/linux/mm/vmscan.c/linux/mm/workingset.c/linux/mm/z3fold.c/linux/mm/zbud.c/linux/mm/zpool.c/linux/mm/zsmalloc.c/linux/mm/zswap.c/linux/net/sunrpc/auth_gss/auth_gss_internal.h/linux/net/sunrpc/auth_gss/svcauth_gss.c/linux/net/sunrpc/svc.c/linux/net/sunrpc/svc_xprt.chelpers.c/linux/scripts/kallsyms.c/linux/scripts/kernel-doc/linux/scripts/module.lds.S/linux/security/Kconfig.hardening/linux/sound/pci/hda/cs35l41_hda.c/linux/tools/cgroup/memcg_slabinfo.py/linux/tools/include/uapi/linux/memfd.h/linux/tools/include/uapi/linux/userfaultfd.h/linux/tools/testing/selftests/cgroup/test_zswap.c/linux/tools/testing/selftests/damon/Makefile/linux/tools/testing/selftests/damon/_damon_sysfs.py/linux/tools/testing/selftests/damon/damos_quota_goal.py/linux/tools/testing/selftests/lib.mk/linux/tools/testing/selftests/memfd/fuse_test.c/linux/tools/testing/selftests/memfd/memfd_test.c/linux/tools/testing/selftests/mm/Makefile/linux/tools/testing/selftests/mm/cow.c/linux/tools/testing/selftests/mm/gup_longterm.c/linux/tools/testing/selftests/mm/hugetlb_madv_vs_map.c/linux/tools/testing/selftests/mm/ksm_functional_tests.c/linux/tools/testing/selftests/mm/memfd_secret.c/linux/tools/testing/selftests/mm/mlock2-tests.c/linux/tools/testing/selftests/mm/mremap_test.c/linux/tools/testing/selftests/mm/run_vmtests.sh/linux/tools/testing/selftests/mm/soft-dirty.c/linux/tools/testing/selftests/mm/virtual_address_range.c/linux/tools/testing/selftests/x86/test_shadow_stack.c/linux/tools/writeback/wb_monitor.py/linux/virt/kvm/kvm_main.c |
97ab3e8e | 01-May-2024 |
Danilo Krummrich <dakr@redhat.com> |
rust: alloc: fix dangling pointer in VecExt<T>::reserve()
Currently, a Vec<T>'s ptr value, after calling Vec<T>::new(), is initialized to Unique::dangling(). Hence, in VecExt<T>::reserve(), we're pa
rust: alloc: fix dangling pointer in VecExt<T>::reserve()
Currently, a Vec<T>'s ptr value, after calling Vec<T>::new(), is initialized to Unique::dangling(). Hence, in VecExt<T>::reserve(), we're passing a dangling pointer (instead of NULL) to krealloc() whenever a new Vec<T>'s backing storage is allocated through VecExt<T> extension functions.
This only works as long as align_of::<T>(), used by Unique::dangling() to derive the dangling pointer, resolves to a value between 0x0 and ZERO_SIZE_PTR (0x10) and krealloc() hence treats it the same as a NULL pointer however.
This isn't a case we should rely on, since there may be types whose alignment may exceed the range still covered by krealloc(), plus other kernel allocators are not as tolerant either.
Instead, pass a real NULL pointer to krealloc_aligned() if Vec<T>'s capacity is zero.
Fixes: 5ab560ce12ed ("rust: alloc: update `VecExt` to take allocation flags") Reviewed-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Boqun Feng <boqun.feng@gmail.com> Reviewed-by: Benno Lossin <benno.lossin@proton.me> Signed-off-by: Danilo Krummrich <dakr@redhat.com> Reviewed-by: Wedson Almeida Filho <walmeida@microsoft.com> Link: https://lore.kernel.org/r/20240501134834.22323-1-dakr@redhat.com [ Solved `use` conflict and applied the `if`-instead-of-`match` change discussed in the list. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
show more ...
|
00280272 | 01-Apr-2024 |
Miguel Ojeda <ojeda@kernel.org> |
rust: kernel: remove redundant imports
Rust's `unused_imports` lint covers both unused and redundant imports. In the upcoming 1.78.0, the lint detects more cases of redundant imports [1], e.g.:
rust: kernel: remove redundant imports
Rust's `unused_imports` lint covers both unused and redundant imports. In the upcoming 1.78.0, the lint detects more cases of redundant imports [1], e.g.:
error: the item `bindings` is imported redundantly --> rust/kernel/print.rs:38:9 | 38 | use crate::bindings; | ^^^^^^^^^^^^^^^ the item `bindings` is already defined by prelude
Most cases are `use crate::bindings`, plus a few other items like `Box`. Thus clean them up.
Note that, in the `bindings` case, the message "defined by prelude" above means the extern prelude, i.e. the `--extern` flags we pass.
Link: https://github.com/rust-lang/rust/pull/117772 [1] Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20240401212303.537355-3-ojeda@kernel.org Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
show more ...
|
7c81aa85 | 01-Apr-2024 |
Miguel Ojeda <ojeda@kernel.org> |
rust: sync: implement `Default` for `LockClassKey`
In the upcoming Rust 1.78.0, Clippy suggests to implement `Default` even when `new()` is `const`, since `Default::default()` may call `const` funct
rust: sync: implement `Default` for `LockClassKey`
In the upcoming Rust 1.78.0, Clippy suggests to implement `Default` even when `new()` is `const`, since `Default::default()` may call `const` functions even if it is not `const` itself [1]:
error: you should consider adding a `Default` implementation for `LockClassKey` --> rust/kernel/sync.rs:31:5 | 31 | / pub const fn new() -> Self { 32 | | Self(Opaque::uninit()) 33 | | } | |_____^
Thus implement it.
Link: https://github.com/rust-lang/rust-clippy/pull/10903 [1] Reviewed-by: Benno Lossin <benno.lossin@proton.me> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Boqun Feng <boqun.feng@gmail.com> Link: https://lore.kernel.org/r/20240401212303.537355-2-ojeda@kernel.org Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
show more ...
|
4a2ae880 | 12-Apr-2024 |
Nell Shamrell-Harrington <nells@linux.microsoft.com> |
rust: remove unneeded `kernel::prelude` imports from doctests
Rust doctests implicitly include `kernel::prelude::*`.
Removes explicit `kernel::prelude` imports from doctests.
Suggested-by: Miguel
rust: remove unneeded `kernel::prelude` imports from doctests
Rust doctests implicitly include `kernel::prelude::*`.
Removes explicit `kernel::prelude` imports from doctests.
Suggested-by: Miguel Ojeda <ojeda@kernel.org> Link: https://github.com/Rust-for-Linux/linux/issues/1064 Signed-off-by: Nell Shamrell-Harrington <nells@linux.microsoft.com> Reviewed-by: Benno Lossin <benno.lossin@proton.me> Link: https://lore.kernel.org/r/20240411225331.274662-1-nells@linux.microsoft.com [ Add it back for `module_phy_driver`'s example since it is within a `mod`, and thus it cannot be removed. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
show more ...
|
ea175b2d | 14-Apr-2024 |
Raghav Narang <dev@raxyte.com> |
rust: update `dbg!()` to format column number
In Rust 1.76.0, the `dbg!()` macro was updated to also format the column number. The reason cited was usage of a few characters worth of horizontal spac
rust: update `dbg!()` to format column number
In Rust 1.76.0, the `dbg!()` macro was updated to also format the column number. The reason cited was usage of a few characters worth of horizontal space while allowing direct jumps to the source location. [1]
Link: https://github.com/rust-lang/rust/pull/114962 [1] Link: https://github.com/Rust-for-Linux/linux/issues/1065 Signed-off-by: Raghav Narang <dev@raxyte.com> Reviewed-by: Trevor Gross <tmgross@umich.edu> Reviewed-by: Gary Guo <gary@garyguo.net> Link: https://lore.kernel.org/r/eba70259-9b10-4bf7-ac4f-d7accf6b8891@smtp-relay.sendinblue.com [ Fixed commit author name and removed spurious newline in message. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
show more ...
|
84373132 | 11-Apr-2024 |
Thorsten Blum <thorsten.blum@toblux.com> |
rust: helpers: Fix grammar in comment
s/directly the bindings/the bindings directly/
Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com> Reviewed-by: Trevor Gross <tmgross@umich.edu> Reviewed-b
rust: helpers: Fix grammar in comment
s/directly the bindings/the bindings directly/
Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com> Reviewed-by: Trevor Gross <tmgross@umich.edu> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20240411205428.537700-1-thorsten.blum@toblux.com Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
show more ...
|
9218cf82 | 03-Apr-2024 |
Benno Lossin <benno.lossin@proton.me> |
rust: init: change the generated name of guard variables
The initializers created by the `[try_][pin_]init!` macros utilize the guard pattern to drop already initialized fields, when initialization
rust: init: change the generated name of guard variables
The initializers created by the `[try_][pin_]init!` macros utilize the guard pattern to drop already initialized fields, when initialization fails mid-way. These guards are generated to have the same name as the field that they handle. To prevent namespacing issues [1] when the field name is the same as e.g. a constant name, add `__` as a prefix and `_guard` as the suffix.
[ Gary says:
"Here's the simplified example:
``` macro_rules! f { () => { let a = 1; let _: u32 = a; } }
const a: u64 = 1;
fn main() { f!(); } ```
The `a` in `f` have a different hygiene so normally it is scoped to the macro expansion and wouldn't escape. Interestingly a constant is still preferred despite the hygiene so constants escaped into the macro, leading to the error."
- Miguel ]
Signed-off-by: Benno Lossin <benno.lossin@proton.me> Reviewed-by: Boqun Feng <boqun.feng@gmail.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/rust-for-linux/1e8a2a1f-abbf-44ba-8344-705a9cbb1627@proton.me/ [1] Link: https://lore.kernel.org/r/20240403194321.88716-1-benno.lossin@proton.me [ Added Benno's link and Gary's simplified example. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
show more ...
|
a0a4e170 | 02-Apr-2024 |
Alice Ryhl <aliceryhl@google.com> |
rust: sync: add `Arc::into_unique_or_drop`
Decrement the refcount of an `Arc`, but handle the case where it hits zero by taking ownership of the now-unique `Arc`, instead of destroying and deallocat
rust: sync: add `Arc::into_unique_or_drop`
Decrement the refcount of an `Arc`, but handle the case where it hits zero by taking ownership of the now-unique `Arc`, instead of destroying and deallocating it.
This is a dependency of the linked list that Rust Binder uses. The linked list uses this method as part of its `ListArc` abstraction [1].
Boqun Feng has authored the examples.
Reviewed-by: Benno Lossin <benno.lossin@proton.me> Reviewed-by: Boqun Feng <boqun.feng@gmail.com> Link: https://lore.kernel.org/r/20240402-linked-list-v1-1-b1c59ba7ae3b@google.com [1] Co-developed-by: Boqun Feng <boqun.feng@gmail.com> Signed-off-by: Boqun Feng <boqun.feng@gmail.com> Signed-off-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20240402-arc-for-list-v4-2-54db6440a9a9@google.com [ Replace `try_new` with `new` in example since we now have the new allocation APIs. - Miguel ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
show more ...
|
51f6af86 | 02-Apr-2024 |
Alice Ryhl <aliceryhl@google.com> |
rust: sync: add `ArcBorrow::from_raw`
Allows access to a value in an `Arc` that is currently held as a raw pointer due to use of `Arc::into_raw`, without destroying or otherwise consuming that raw p
rust: sync: add `ArcBorrow::from_raw`
Allows access to a value in an `Arc` that is currently held as a raw pointer due to use of `Arc::into_raw`, without destroying or otherwise consuming that raw pointer.
This is a dependency of the linked list that Rust Binder uses. The linked list uses this method when iterating over the linked list [1].
Reviewed-by: Benno Lossin <benno.lossin@proton.me> Reviewed-by: Boqun Feng <boqun.feng@gmail.com> Link: https://lore.kernel.org/r/20240402-linked-list-v1-6-b1c59ba7ae3b@google.com [1] Signed-off-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20240402-arc-for-list-v4-1-54db6440a9a9@google.com Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
show more ...
|
be2ca1e0 | 01-Apr-2024 |
Boqun Feng <boqun.feng@gmail.com> |
rust: types: Make Opaque::get const
To support a potential usage:
static foo: Opaque<Foo> = ..; // Or defined in an extern block.
...
fn bar() { let ptr = foo.get(); }
`O
rust: types: Make Opaque::get const
To support a potential usage:
static foo: Opaque<Foo> = ..; // Or defined in an extern block.
...
fn bar() { let ptr = foo.get(); }
`Opaque::get` need to be `const`, otherwise compiler will complain because calls on statics are limited to const functions.
Also `Opaque::get` should be naturally `const` since it's a composition of two `const` functions: `UnsafeCell::get` and `ptr::cast`.
Signed-off-by: Boqun Feng <boqun.feng@gmail.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Wedson Almeida Filho <walmeida@microsoft.com> Reviewed-by: Benno Lossin <benno.lossin@proton.me> Link: https://lore.kernel.org/r/20240401214543.1242286-1-boqun.feng@gmail.com Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
show more ...
|
ddd91209 | 12-Apr-2024 |
Boqun Feng <boqun.feng@gmail.com> |
rust: time: doc: Add missing C header links
The definitions related to jiffies are at linux/jiffies.h, and the definitions related to ktime_t are at linux/ktime.h, since `kernel::time` provides the
rust: time: doc: Add missing C header links
The definitions related to jiffies are at linux/jiffies.h, and the definitions related to ktime_t are at linux/ktime.h, since `kernel::time` provides the functionality dealing with jiffies and ktime_t, it makes sense to add links to them from Rust's time module.
Signed-off-by: Boqun Feng <boqun.feng@gmail.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Acked-by: Miguel Ojeda <ojeda@kernel.org> Link: https://lore.kernel.org/r/20240411230801.1504496-2-boqun.feng@gmail.com
show more ...
|
19843452 | 19-Apr-2024 |
Aswin Unnikrishnan <aswinunni01@gmail.com> |
rust: remove `params` from `module` macro example
Remove argument `params` from the `module` macro example, because the macro does not currently support module parameters since it was not sent with
rust: remove `params` from `module` macro example
Remove argument `params` from the `module` macro example, because the macro does not currently support module parameters since it was not sent with the initial merge.
Signed-off-by: Aswin Unnikrishnan <aswinunni01@gmail.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Cc: stable@vger.kernel.org Fixes: 1fbde52bde73 ("rust: add `macros` crate") Link: https://lore.kernel.org/r/20240419215015.157258-1-aswinunni01@gmail.com [ Reworded slightly. ] Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
show more ...
|
50cfe93b | 22-Apr-2024 |
Miguel Ojeda <ojeda@kernel.org> |
kbuild: rust: remove unneeded `@rustc_cfg` to avoid ICE
When KUnit tests are enabled, under very big kernel configurations (e.g. `allyesconfig`), we can trigger a `rustdoc` ICE [1]:
RUSTDOC T
kbuild: rust: remove unneeded `@rustc_cfg` to avoid ICE
When KUnit tests are enabled, under very big kernel configurations (e.g. `allyesconfig`), we can trigger a `rustdoc` ICE [1]:
RUSTDOC TK rust/kernel/lib.rs error: the compiler unexpectedly panicked. this is a bug.
The reason is that this build step has a duplicated `@rustc_cfg` argument, which contains the kernel configuration, and thus a lot of arguments. The factor 2 happens to be enough to reach the ICE.
Thus remove the unneeded `@rustc_cfg`. By doing so, we clean up the command and workaround the ICE.
The ICE has been fixed in the upcoming Rust 1.79 [2].
Cc: stable@vger.kernel.org Fixes: a66d733da801 ("rust: support running Rust documentation tests as KUnit ones") Link: https://github.com/rust-lang/rust/issues/122722 [1] Link: https://github.com/rust-lang/rust/pull/122840 [2] Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20240422091215.526688-1-ojeda@kernel.org Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
show more ...
|
323617f6 | 28-Mar-2024 |
Wedson Almeida Filho <walmeida@microsoft.com> |
rust: kernel: require `Send` for `Module` implementations
The thread that calls the module initialisation code when a module is loaded is not guaranteed [in fact, it is unlikely] to be the same one
rust: kernel: require `Send` for `Module` implementations
The thread that calls the module initialisation code when a module is loaded is not guaranteed [in fact, it is unlikely] to be the same one that calls the module cleanup code on module unload, therefore, `Module` implementations must be `Send` to account for them moving from one thread to another implicitly.
Signed-off-by: Wedson Almeida Filho <walmeida@microsoft.com> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Benno Lossin <benno.lossin@proton.me> Cc: stable@vger.kernel.org # 6.8.x: df70d04d5697: rust: phy: implement `Send` for `Registration` Cc: stable@vger.kernel.org Fixes: 247b365dc8dc ("rust: add `kernel` crate") Link: https://lore.kernel.org/r/20240328195457.225001-3-wedsonaf@gmail.com Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
show more ...
|