Merge tag 'mm-hotfixes-stable-2025-02-01-03-56' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Merge commit. Changes below are compared with the first parent: c6fe03a3.
Changes
34 files changed · +386 −448
Only the first 600 diff lines are shown. Download the complete patch.
.mailmap
View filediff --git a/.mailmap b/.mailmap
index 1c007de..ae0adc4 100644
--- a/.mailmap
+++ b/.mailmap
@@ -150,7 +150,9 @@ Bryan Tan <[email protected]> <[email protected]>
Cai Huoqing <[email protected]> <[email protected]>
Can Guo <[email protected]> <[email protected]>
Carl Huang <[email protected]> <[email protected]>
-Carlos Bilbao <[email protected]> <[email protected]>
+Carlos Bilbao <[email protected]> <[email protected]>
+Carlos Bilbao <[email protected]> <[email protected]>
+Carlos Bilbao <[email protected]> <[email protected]>
Changbin Du <[email protected]> <[email protected]>
Changbin Du <[email protected]> <[email protected]>
Chao Yu <[email protected]> <[email protected]>
@@ -167,6 +169,7 @@ Christian Brauner <[email protected]> <[email protected]>
Christian Brauner <[email protected]> <[email protected]>
Christian Marangi <[email protected]>
Christophe Ricard <[email protected]>
+Christopher Obbard <[email protected]> <[email protected]>
Christoph Hellwig <[email protected]>
Chuck Lever <[email protected]> <[email protected]>
Chuck Lever <[email protected]> <[email protected]>
@@ -263,6 +266,7 @@ Guo Ren <[email protected]> <[email protected]>
Guru Das Srinagesh <[email protected]> <[email protected]>
Gustavo Padovan <[email protected]>
Gustavo Padovan <[email protected]>
+Hamza Mahfooz <[email protected]> <[email protected]>
Hanjun Guo <[email protected]> <[email protected]>
Hans Verkuil <[email protected]> <[email protected]>
Hans Verkuil <[email protected]> <[email protected]>
@@ -763,6 +767,7 @@ Wolfram Sang <[email protected]> <[email protected]>
Yakir Yang <[email protected]> <[email protected]>
Yanteng Si <[email protected]> <[email protected]>
Ying Huang <[email protected]> <[email protected]>
+Yosry Ahmed <[email protected]> <[email protected]>
Yusuke Goda <[email protected]>
Zack Rusin <[email protected]> <[email protected]>
Zhu Yanjun <[email protected]> <[email protected]>
Documentation/translations/sp_SP/index.rst
View filediff --git a/Documentation/translations/sp_SP/index.rst b/Documentation/translations/sp_SP/index.rst
index aae7018..2b50283 100644
--- a/Documentation/translations/sp_SP/index.rst
+++ b/Documentation/translations/sp_SP/index.rst
@@ -7,7 +7,7 @@ Traducción al español
\kerneldocCJKoff
-:maintainer: Carlos Bilbao <[email protected]>
+:maintainer: Carlos Bilbao <[email protected]>
.. _sp_disclaimer:
MAINTAINERS
View filediff --git a/MAINTAINERS b/MAINTAINERS
index 857b301..896a307 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1090,7 +1090,7 @@ F: drivers/video/fbdev/geode/
AMD HSMP DRIVER
M: Naveen Krishna Chatradhi <[email protected]>
-R: Carlos Bilbao <[email protected]>
+R: Carlos Bilbao <[email protected]>
S: Maintained
F: Documentation/arch/x86/amd_hsmp.rst
@@ -5857,7 +5857,7 @@ F: drivers/usb/atm/cxacru.c
CONFIDENTIAL COMPUTING THREAT MODEL FOR X86 VIRTUALIZATION (SNP/TDX)
M: Elena Reshetova <[email protected]>
-M: Carlos Bilbao <[email protected]>
+M: Carlos Bilbao <[email protected]>
S: Maintained
F: Documentation/security/snp-tdx-threat-model.rst
@@ -11331,7 +11331,7 @@ S: Orphan
F: drivers/video/fbdev/imsttfb.c
INDEX OF FURTHER KERNEL DOCUMENTATION
-M: Carlos Bilbao <[email protected]>
+M: Carlos Bilbao <[email protected]>
S: Maintained
F: Documentation/process/kernel-docs.rst
@@ -22215,7 +22215,7 @@ Q: http://patchwork.linuxtv.org/project/linux-media/list/
F: drivers/media/dvb-frontends/sp2*
SPANISH DOCUMENTATION
-M: Carlos Bilbao <[email protected]>
+M: Carlos Bilbao <[email protected]>
R: Avadhut Naik <[email protected]>
S: Maintained
F: Documentation/translations/sp_SP/
@@ -25739,11 +25739,13 @@ F: arch/x86/entry/vdso/
XARRAY
M: Matthew Wilcox <[email protected]>
S: Supported
F: Documentation/core-api/xarray.rst
F: include/linux/idr.h
F: include/linux/xarray.h
F: lib/idr.c
+F: lib/test_xarray.c
F: lib/xarray.c
F: tools/testing/radix-tree
@@ -26223,7 +26225,7 @@ K: zstd
ZSWAP COMPRESSED SWAP CACHING
M: Johannes Weiner <[email protected]>
-M: Yosry Ahmed <[email protected]>
+M: Yosry Ahmed <[email protected]>
M: Nhat Pham <[email protected]>
R: Chengming Zhou <[email protected]>
arch/m68k/configs/amiga_defconfig
View filediff --git a/arch/m68k/configs/amiga_defconfig b/arch/m68k/configs/amiga_defconfig
index 8acfa66..dbf2ea5 100644
--- a/arch/m68k/configs/amiga_defconfig
+++ b/arch/m68k/configs/amiga_defconfig
@@ -626,6 +626,7 @@ CONFIG_TEST_PRINTF=m
CONFIG_TEST_SCANF=m
CONFIG_TEST_BITMAP=m
CONFIG_TEST_UUID=m
+CONFIG_TEST_XARRAY=m
CONFIG_TEST_MAPLE_TREE=m
CONFIG_TEST_RHASHTABLE=m
CONFIG_TEST_IDA=m
arch/m68k/configs/apollo_defconfig
View filediff --git a/arch/m68k/configs/apollo_defconfig b/arch/m68k/configs/apollo_defconfig
index 35e9a08..b0fd199 100644
--- a/arch/m68k/configs/apollo_defconfig
+++ b/arch/m68k/configs/apollo_defconfig
@@ -583,6 +583,7 @@ CONFIG_TEST_PRINTF=m
CONFIG_TEST_SCANF=m
CONFIG_TEST_BITMAP=m
CONFIG_TEST_UUID=m
+CONFIG_TEST_XARRAY=m
CONFIG_TEST_MAPLE_TREE=m
CONFIG_TEST_RHASHTABLE=m
CONFIG_TEST_IDA=m
arch/m68k/configs/atari_defconfig
View filediff --git a/arch/m68k/configs/atari_defconfig b/arch/m68k/configs/atari_defconfig
index 32891dd..bb5b2d3 100644
--- a/arch/m68k/configs/atari_defconfig
+++ b/arch/m68k/configs/atari_defconfig
@@ -603,6 +603,7 @@ CONFIG_TEST_PRINTF=m
CONFIG_TEST_SCANF=m
CONFIG_TEST_BITMAP=m
CONFIG_TEST_UUID=m
+CONFIG_TEST_XARRAY=m
CONFIG_TEST_MAPLE_TREE=m
CONFIG_TEST_RHASHTABLE=m
CONFIG_TEST_IDA=m
arch/m68k/configs/bvme6000_defconfig
View filediff --git a/arch/m68k/configs/bvme6000_defconfig b/arch/m68k/configs/bvme6000_defconfig
index ca276f0..8315a13 100644
--- a/arch/m68k/configs/bvme6000_defconfig
+++ b/arch/m68k/configs/bvme6000_defconfig
@@ -575,6 +575,7 @@ CONFIG_TEST_PRINTF=m
CONFIG_TEST_SCANF=m
CONFIG_TEST_BITMAP=m
CONFIG_TEST_UUID=m
+CONFIG_TEST_XARRAY=m
CONFIG_TEST_MAPLE_TREE=m
CONFIG_TEST_RHASHTABLE=m
CONFIG_TEST_IDA=m
arch/m68k/configs/hp300_defconfig
View filediff --git a/arch/m68k/configs/hp300_defconfig b/arch/m68k/configs/hp300_defconfig
index e83f14f..3503706 100644
--- a/arch/m68k/configs/hp300_defconfig
+++ b/arch/m68k/configs/hp300_defconfig
@@ -585,6 +585,7 @@ CONFIG_TEST_PRINTF=m
CONFIG_TEST_SCANF=m
CONFIG_TEST_BITMAP=m
CONFIG_TEST_UUID=m
+CONFIG_TEST_XARRAY=m
CONFIG_TEST_MAPLE_TREE=m
CONFIG_TEST_RHASHTABLE=m
CONFIG_TEST_IDA=m
arch/m68k/configs/mac_defconfig
View filediff --git a/arch/m68k/configs/mac_defconfig b/arch/m68k/configs/mac_defconfig
index 6b58be2..f942b47 100644
--- a/arch/m68k/configs/mac_defconfig
+++ b/arch/m68k/configs/mac_defconfig
@@ -602,6 +602,7 @@ CONFIG_TEST_PRINTF=m
CONFIG_TEST_SCANF=m
CONFIG_TEST_BITMAP=m
CONFIG_TEST_UUID=m
+CONFIG_TEST_XARRAY=m
CONFIG_TEST_MAPLE_TREE=m
CONFIG_TEST_RHASHTABLE=m
CONFIG_TEST_IDA=m
arch/m68k/configs/multi_defconfig
View filediff --git a/arch/m68k/configs/multi_defconfig b/arch/m68k/configs/multi_defconfig
index 0e8d24f..b1eaad0 100644
--- a/arch/m68k/configs/multi_defconfig
+++ b/arch/m68k/configs/multi_defconfig
@@ -689,6 +689,7 @@ CONFIG_TEST_PRINTF=m
CONFIG_TEST_SCANF=m
CONFIG_TEST_BITMAP=m
CONFIG_TEST_UUID=m
+CONFIG_TEST_XARRAY=m
CONFIG_TEST_MAPLE_TREE=m
CONFIG_TEST_RHASHTABLE=m
CONFIG_TEST_IDA=m
arch/m68k/configs/mvme147_defconfig
View filediff --git a/arch/m68k/configs/mvme147_defconfig b/arch/m68k/configs/mvme147_defconfig
index 24a7608..6309a44 100644
--- a/arch/m68k/configs/mvme147_defconfig
+++ b/arch/m68k/configs/mvme147_defconfig
@@ -575,6 +575,7 @@ CONFIG_TEST_PRINTF=m
CONFIG_TEST_SCANF=m
CONFIG_TEST_BITMAP=m
CONFIG_TEST_UUID=m
+CONFIG_TEST_XARRAY=m
CONFIG_TEST_MAPLE_TREE=m
CONFIG_TEST_RHASHTABLE=m
CONFIG_TEST_IDA=m
arch/m68k/configs/mvme16x_defconfig
View filediff --git a/arch/m68k/configs/mvme16x_defconfig b/arch/m68k/configs/mvme16x_defconfig
index c415f75..3feb073 100644
--- a/arch/m68k/configs/mvme16x_defconfig
+++ b/arch/m68k/configs/mvme16x_defconfig
@@ -576,6 +576,7 @@ CONFIG_TEST_PRINTF=m
CONFIG_TEST_SCANF=m
CONFIG_TEST_BITMAP=m
CONFIG_TEST_UUID=m
+CONFIG_TEST_XARRAY=m
CONFIG_TEST_MAPLE_TREE=m
CONFIG_TEST_RHASHTABLE=m
CONFIG_TEST_IDA=m
arch/m68k/configs/q40_defconfig
View filediff --git a/arch/m68k/configs/q40_defconfig b/arch/m68k/configs/q40_defconfig
index 2c715a8..ea04b1b 100644
--- a/arch/m68k/configs/q40_defconfig
+++ b/arch/m68k/configs/q40_defconfig
@@ -592,6 +592,7 @@ CONFIG_TEST_PRINTF=m
CONFIG_TEST_SCANF=m
CONFIG_TEST_BITMAP=m
CONFIG_TEST_UUID=m
+CONFIG_TEST_XARRAY=m
CONFIG_TEST_MAPLE_TREE=m
CONFIG_TEST_RHASHTABLE=m
CONFIG_TEST_IDA=m
arch/m68k/configs/sun3_defconfig
View filediff --git a/arch/m68k/configs/sun3_defconfig b/arch/m68k/configs/sun3_defconfig
index 15ff37f..f52d9af 100644
--- a/arch/m68k/configs/sun3_defconfig
+++ b/arch/m68k/configs/sun3_defconfig
@@ -572,6 +572,7 @@ CONFIG_TEST_PRINTF=m
CONFIG_TEST_SCANF=m
CONFIG_TEST_BITMAP=m
CONFIG_TEST_UUID=m
+CONFIG_TEST_XARRAY=m
CONFIG_TEST_MAPLE_TREE=m
CONFIG_TEST_RHASHTABLE=m
CONFIG_TEST_IDA=m
arch/m68k/configs/sun3x_defconfig
View filediff --git a/arch/m68k/configs/sun3x_defconfig b/arch/m68k/configs/sun3x_defconfig
index 40a44bf..f348447 100644
--- a/arch/m68k/configs/sun3x_defconfig
+++ b/arch/m68k/configs/sun3x_defconfig
@@ -573,6 +573,7 @@ CONFIG_TEST_PRINTF=m
CONFIG_TEST_SCANF=m
CONFIG_TEST_BITMAP=m
CONFIG_TEST_UUID=m
+CONFIG_TEST_XARRAY=m
CONFIG_TEST_MAPLE_TREE=m
CONFIG_TEST_RHASHTABLE=m
CONFIG_TEST_IDA=m
arch/powerpc/configs/ppc64_defconfig
View filediff --git a/arch/powerpc/configs/ppc64_defconfig b/arch/powerpc/configs/ppc64_defconfig
index e9c46b5..465eb96 100644
--- a/arch/powerpc/configs/ppc64_defconfig
+++ b/arch/powerpc/configs/ppc64_defconfig
@@ -448,6 +448,7 @@ CONFIG_TEST_PRINTF=m
CONFIG_TEST_SCANF=m
CONFIG_TEST_BITMAP=m
CONFIG_TEST_UUID=m
+CONFIG_TEST_XARRAY=m
CONFIG_TEST_MAPLE_TREE=m
CONFIG_TEST_RHASHTABLE=m
CONFIG_TEST_IDA=m
drivers/acpi/numa/srat.c
View filediff --git a/drivers/acpi/numa/srat.c b/drivers/acpi/numa/srat.c
index 59fffe3..00ac0d7 100644
--- a/drivers/acpi/numa/srat.c
+++ b/drivers/acpi/numa/srat.c
@@ -95,9 +95,13 @@ int __init fix_pxm_node_maps(int max_nid)
int i, j, index = -1, count = 0;
nodemask_t nodes_to_enable;
- if (numa_off || srat_disabled())
+ if (numa_off)
return -1;
+ /* no or incomplete node/PXM mapping set, nothing to do */
+ if (srat_disabled())
+ return 0;
+
/* find fake nodes PXM mapping */
for (i = 0; i < MAX_NUMNODES; i++) {
if (node_to_pxm_map[i] != PXM_INVAL) {
@@ -117,6 +121,11 @@ int __init fix_pxm_node_maps(int max_nid)
}
}
}
+ if (index == -1) {
+ pr_debug("No node/PXM mapping has been set\n");
+ /* nothing more to be done */
+ return 0;
+ }
if (WARN(index != max_nid, "%d max nid when expected %d\n",
index, max_nid))
return -1;
fs/nilfs2/inode.c
View filediff --git a/fs/nilfs2/inode.c b/fs/nilfs2/inode.c
index e8015d2..6613b8f 100644
--- a/fs/nilfs2/inode.c
+++ b/fs/nilfs2/inode.c
@@ -1186,7 +1186,7 @@ int nilfs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
if (size) {
if (phys && blkphy << blkbits == phys + size) {
/* The current extent goes on */
- size += n << blkbits;
+ size += (u64)n << blkbits;
} else {
/* Terminate the current extent */
ret = fiemap_fill_next_extent(
@@ -1199,14 +1199,14 @@ int nilfs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
flags = FIEMAP_EXTENT_MERGED;
logical = blkoff << blkbits;
phys = blkphy << blkbits;
- size = n << blkbits;
+ size = (u64)n << blkbits;
}
} else {
/* Start a new extent */
flags = FIEMAP_EXTENT_MERGED;
logical = blkoff << blkbits;
phys = blkphy << blkbits;
- size = n << blkbits;
+ size = (u64)n << blkbits;
}
blkoff += n;
}
fs/ocfs2/super.c
View filediff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index e0b91db..8bb5022 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -2285,7 +2285,7 @@ static int ocfs2_verify_volume(struct ocfs2_dinode *di,
mlog(ML_ERROR, "found superblock with incorrect block "
"size bits: found %u, should be 9, 10, 11, or 12\n",
blksz_bits);
- } else if ((1 << le32_to_cpu(blksz_bits)) != blksz) {
+ } else if ((1 << blksz_bits) != blksz) {
mlog(ML_ERROR, "found superblock with incorrect block "
"size: found %u, should be %u\n", 1 << blksz_bits, blksz);
} else if (le16_to_cpu(di->id2.i_super.s_major_rev_level) !=
include/linux/swap.h
View filediff --git a/include/linux/swap.h b/include/linux/swap.h
index a5f4753..b13b726 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -222,6 +222,7 @@ enum {
};
#define SWAP_CLUSTER_MAX 32UL
+#define SWAP_CLUSTER_MAX_SKIPPED (SWAP_CLUSTER_MAX << 10)
#define COMPACT_CLUSTER_MAX SWAP_CLUSTER_MAX
/* Bit flag in swap_map */
kernel/events/uprobes.c
View filediff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index e421a5f..2ca797c 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -28,6 +28,7 @@
#include <linux/rcupdate_trace.h>
#include <linux/workqueue.h>
#include <linux/srcu.h>
+#include <linux/oom.h> /* check_stable_address_space */
#include <linux/uprobes.h>
@@ -1260,6 +1261,9 @@ register_for_each_vma(struct uprobe *uprobe, struct uprobe_consumer *new)
* returns NULL in find_active_uprobe_rcu().
*/
mmap_write_lock(mm);
+ if (check_stable_address_space(mm))
+ goto unlock;
+
vma = find_vma(mm, info->vaddr);
if (!vma || !valid_vma(vma, is_register) ||
file_inode(vma->vm_file) != uprobe->inode)
kernel/fork.c
View filediff --git a/kernel/fork.c b/kernel/fork.c
index cba5ede..735405a 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -760,7 +760,8 @@ loop_out:
mt_set_in_rcu(vmi.mas.tree);
ksm_fork(mm, oldmm);
khugepaged_fork(mm, oldmm);
- } else if (mpnt) {
+ } else {
+
/*
* The entire maple tree has already been duplicated. If the
* mmap duplication fails, mark the failure point with
@@ -768,8 +769,18 @@ loop_out:
* stop releasing VMAs that have not been duplicated after this
* point.
*/
- mas_set_range(&vmi.mas, mpnt->vm_start, mpnt->vm_end - 1);
- mas_store(&vmi.mas, XA_ZERO_ENTRY);
+ if (mpnt) {
+ mas_set_range(&vmi.mas, mpnt->vm_start, mpnt->vm_end - 1);
+ mas_store(&vmi.mas, XA_ZERO_ENTRY);
+ /* Avoid OOM iterating a broken tree */
+ set_bit(MMF_OOM_SKIP, &mm->flags);
+ }
+ /*
+ * The mm_struct is going to exit, but the locks will be dropped
+ * first. Set the mm_struct as unstable is advisable as it is
+ * not fully initialised.
+ */
+ set_bit(MMF_UNSTABLE, &mm->flags);
}
out:
mmap_write_unlock(mm);
lib/Kconfig.debug
View filediff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 775966c..1af972a 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -2456,22 +2456,8 @@ config TEST_BITMAP
config TEST_UUID
tristate "Test functions located in the uuid module at runtime"
-config XARRAY_KUNIT
- tristate "KUnit test XArray code at runtime" if !KUNIT_ALL_TESTS
- depends on KUNIT
- default KUNIT_ALL_TESTS
- help
- Enable this option to test the Xarray code at boot.
-
- KUnit tests run during boot and output the results to the debug log
- in TAP format (http://testanything.org/). Only useful for kernel devs
- running the KUnit test harness, and not intended for inclusion into a
- production build.
-
- For more information on KUnit and unit tests in general please refer
- to the KUnit documentation in Documentation/dev-tools/kunit/.
-
- If unsure, say N.
+config TEST_XARRAY
+ tristate "Test the XArray code at runtime"
config TEST_MAPLE_TREE
tristate "Test the Maple Tree code at runtime or module load"
lib/Makefile
View filediff --git a/lib/Makefile b/lib/Makefile
index f1c6e9d..d5cfc7a 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -94,6 +94,7 @@ GCOV_PROFILE_test_bitmap.o := n
endif
obj-$(CONFIG_TEST_UUID) += test_uuid.o
+obj-$(CONFIG_TEST_XARRAY) += test_xarray.o
obj-$(CONFIG_TEST_MAPLE_TREE) += test_maple_tree.o
obj-$(CONFIG_TEST_PARMAN) += test_parman.o
obj-$(CONFIG_TEST_KMOD) += test_kmod.o
@@ -372,7 +373,6 @@ CFLAGS_bitfield_kunit.o := $(DISABLE_STRUCTLEAK_PLUGIN)
obj-$(CONFIG_BITFIELD_KUNIT) += bitfield_kunit.o
obj-$(CONFIG_CHECKSUM_KUNIT) += checksum_kunit.o
obj-$(CONFIG_UTIL_MACROS_KUNIT) += util_macros_kunit.o
-obj-$(CONFIG_XARRAY_KUNIT) += test_xarray.o
obj-$(CONFIG_LIST_KUNIT_TEST) += list-test.o
obj-$(CONFIG_HASHTABLE_KUNIT_TEST) += hashtable_test.o
obj-$(CONFIG_LINEAR_RANGES_TEST) += test_linear_ranges.o
lib/test_xarray.c
View filediff --git a/lib/test_xarray.c b/lib/test_xarray.c
index eab5971..6932a26 100644
--- a/lib/test_xarray.c
+++ b/lib/test_xarray.c
@@ -6,10 +6,11 @@
* Author: Matthew Wilcox <[email protected]>
*/
-#include <kunit/test.h>
-
-#include <linux/module.h>
#include <linux/xarray.h>
+#include <linux/module.h>
+
+static unsigned int tests_run;
+static unsigned int tests_passed;
static const unsigned int order_limit =
IS_ENABLED(CONFIG_XARRAY_MULTI) ? BITS_PER_LONG : 1;
@@ -19,12 +20,15 @@ static const unsigned int order_limit =
void xa_dump(const struct xarray *xa) { }
# endif
#undef XA_BUG_ON
-#define XA_BUG_ON(xa, x) do { \
- if (x) { \
- KUNIT_FAIL(test, #x); \
- xa_dump(xa); \
- dump_stack(); \
- } \
+#define XA_BUG_ON(xa, x) do { \
+ tests_run++; \
+ if (x) { \
+ printk("BUG at %s:%d\n", __func__, __LINE__); \
+ xa_dump(xa); \
+ dump_stack(); \
+ } else { \
+ tests_passed++; \
+ } \
} while (0)
#endif
@@ -38,13 +42,13 @@ static void *xa_store_index(struct xarray *xa, unsigned long index, gfp_t gfp)
return xa_store(xa, index, xa_mk_index(index), gfp);
}
-static void xa_insert_index(struct kunit *test, struct xarray *xa, unsigned long index)
+static void xa_insert_index(struct xarray *xa, unsigned long index)
{
XA_BUG_ON(xa, xa_insert(xa, index, xa_mk_index(index),
GFP_KERNEL) != 0);
}
-static void xa_alloc_index(struct kunit *test, struct xarray *xa, unsigned long index, gfp_t gfp)
+static void xa_alloc_index(struct xarray *xa, unsigned long index, gfp_t gfp)
{
u32 id;
@@ -53,7 +57,7 @@ static void xa_alloc_index(struct kunit *test, struct xarray *xa, unsigned long
XA_BUG_ON(xa, id != index);
}
-static void xa_erase_index(struct kunit *test, struct xarray *xa, unsigned long index)
+static void xa_erase_index(struct xarray *xa, unsigned long index)
{
XA_BUG_ON(xa, xa_erase(xa, index) != xa_mk_index(index));
XA_BUG_ON(xa, xa_load(xa, index) != NULL);
@@ -79,15 +83,8 @@ static void *xa_store_order(struct xarray *xa, unsigned long index,
return curr;
}
-static inline struct xarray *xa_param(struct kunit *test)
+static noinline void check_xa_err(struct xarray *xa)
{
- return *(struct xarray **)test->param_value;
-}
-
-static noinline void check_xa_err(struct kunit *test)
-{
- struct xarray *xa = xa_param(test);
-
XA_BUG_ON(xa, xa_err(xa_store_index(xa, 0, GFP_NOWAIT)) != 0);
XA_BUG_ON(xa, xa_err(xa_erase(xa, 0)) != 0);
#ifndef __KERNEL__
@@ -102,10 +99,8 @@ static noinline void check_xa_err(struct kunit *test)
// XA_BUG_ON(xa, xa_err(xa_store(xa, 0, xa_mk_internal(0), 0)) != -EINVAL);
}
-static noinline void check_xas_retry(struct kunit *test)
+static noinline void check_xas_retry(struct xarray *xa)
{
- struct xarray *xa = xa_param(test);
-
XA_STATE(xas, xa, 0);
void *entry;
@@ -114,7 +109,7 @@ static noinline void check_xas_retry(struct kunit *test)
rcu_read_lock();
XA_BUG_ON(xa, xas_find(&xas, ULONG_MAX) != xa_mk_value(0));
- xa_erase_index(test, xa, 1);
+ xa_erase_index(xa, 1);
XA_BUG_ON(xa, !xa_is_retry(xas_reload(&xas)));
XA_BUG_ON(xa, xas_retry(&xas, NULL));
XA_BUG_ON(xa, xas_retry(&xas, xa_mk_value(0)));
@@ -145,14 +140,12 @@ static noinline void check_xas_retry(struct kunit *test)
}
xas_unlock(&xas);
- xa_erase_index(test, xa, 0);
- xa_erase_index(test, xa, 1);
+ xa_erase_index(xa, 0);
+ xa_erase_index(xa, 1);
}
-static noinline void check_xa_load(struct kunit *test)
+static noinline void check_xa_load(struct xarray *xa)
{
- struct xarray *xa = xa_param(test);
-
unsigned long i, j;
for (i = 0; i < 1024; i++) {
@@ -174,15 +167,13 @@ static noinline void check_xa_load(struct kunit *test)
else
XA_BUG_ON(xa, entry);
}
- xa_erase_index(test, xa, i);
+ xa_erase_index(xa, i);
}
XA_BUG_ON(xa, !xa_empty(xa));
}
-static noinline void check_xa_mark_1(struct kunit *test, unsigned long index)
+static noinline void check_xa_mark_1(struct xarray *xa, unsigned long index)
{
- struct xarray *xa = xa_param(test);
-
This diff is incomplete. Download the complete patch.
mm/compaction.c
View fileThis diff is incomplete. Download the complete patch.
mm/gup.c
View fileThis diff is incomplete. Download the complete patch.
mm/hugetlb.c
View fileThis diff is incomplete. Download the complete patch.
mm/kfence/core.c
View fileThis diff is incomplete. Download the complete patch.
mm/kmemleak.c
View fileThis diff is incomplete. Download the complete patch.
mm/swapfile.c
View fileThis diff is incomplete. Download the complete patch.
mm/vmscan.c
View fileThis diff is incomplete. Download the complete patch.
mm/zsmalloc.c
View fileThis diff is incomplete. Download the complete patch.
scripts/gdb/linux/cpus.py
View fileThis diff is incomplete. Download the complete patch.