linux/include
Pankaj Raghav a488ba3124 huge_memory: return -EINVAL in folio split functions when THP is disabled
split_huge_page_to_list_[to_order](), split_huge_page() and
try_folio_split() return 0 on success and error codes on failure.

When THP is disabled, these functions return 0 indicating success even
though an error code should be returned as it is not possible to split a
folio when THP is disabled.

Make all these functions return -EINVAL to indicate failure instead of 0. 
As large folios depend on CONFIG_THP, issue warning as this function
should not be called without a large folio.

Link: https://lkml.kernel.org/r/20250905150012.93714-1-kernel@pankajraghav.com
Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202509051753.riCeG7LC-lkp@intel.com/
Acked-by: David Hildenbrand <david@redhat.com>
Acked-by: Zi Yan <ziy@nvidia.com>
Acked-by: Kiryl Shutsemau <kas@kernel.org>
Reviewed-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reviewed-by: Barry Song <baohua@kernel.org>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2025-09-21 14:22:20 -07:00
..
acpi mailbox/pcc: support mailbox management of the shared buffer 2025-08-07 23:49:56 -05:00
asm-generic mm: convert page_to_section() to memdesc_section() 2025-09-13 16:55:07 -07:00
clocksource
crypto crypto: remove nth_page() usage within SG entry 2025-09-21 14:22:09 -07:00
cxl
drm drm/gpuvm: fix various typos in .c and .h gpuvm file 2025-08-25 21:48:50 +02:00
dt-bindings Pin control changes for v6.17 2025-08-02 12:07:09 -07:00
hyperv
keys
kunit linux_kselftest-kunit-6.17-rc1 2025-07-29 12:43:10 -07:00
kvm KVM/arm64 changes for 6.17, round #1 2025-07-29 12:27:40 -04:00
linux huge_memory: return -EINVAL in folio split functions when THP is disabled 2025-09-21 14:22:20 -07:00
math-emu
media
memory
misc
net net: rose: convert 'use' field to refcount_t 2025-08-27 07:43:08 -07:00
pcmcia
ras tracing, AER: Hide PCIe AER event when PCIEAER is not configured 2025-07-21 16:40:56 -04:00
rdma IB: Extend UVERBS_METHOD_REG_MR to get DMAH 2025-07-23 01:42:11 -04:00
rv rv: Retry when da monitor detects race conditions 2025-07-28 16:47:34 -04:00
scsi Merge patch series "libsas cleanups" 2025-07-25 09:05:23 -04:00
soc This is the usual collection of primarily clk driver updates. The big part of 2025-07-31 13:36:27 -07:00
sound ASoC: Fixes for v6.17 2025-08-21 09:02:28 +02:00
target
trace kmem/tracing: add kmem name to kmem_cache_alloc tracepoint 2025-09-13 16:55:18 -07:00
uapi mm/huge_memory: respect MADV_COLLAPSE with PR_THP_DISABLE_EXCEPT_ADVISED 2025-09-13 16:55:05 -07:00
ufs
vdso
video
xen Significant patch series in this pull request: 2025-08-03 16:23:09 -07:00
Kbuild