tools-separate-out-shared-radix-tree-components.patch removed from -mm tree
The quilt patch titled
Subject: tools: separate out shared radix-tree components
has been removed from the -mm tree. Its filename was
tools-separate-out-shared-radix-tree-components.patch
This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Lorenzo Stoakes <[email protected]>
Subject: tools: separate out shared radix-tree components
Date: Mon, 29 Jul 2024 12:50:40 +0100
The core components contained within the radix-tree tests which provide shims for kernel headers and access to the maple tree are useful for testing other things, so separate them out and make the radix tree tests dependent on the shared components.
This lays the groundwork for us to add VMA tests of the newly introduced vma.c file.
---
tools/testing/radix-tree/.gitignore | 1 tools/testing/radix-tree/Makefile | 72 -- tools/testing/radix-tree/generated/autoconf.h | 2 tools/testing/radix-tree/linux.c | 271 ----------- tools/testing/radix-tree/linux/bug.h | 2 tools/testing/radix-tree/linux/cpu.h | 1 tools/testing/radix-tree/linux/idr.h | 1 tools/testing/radix-tree/linux/init.h | 2 tools/testing/radix-tree/linux/kconfig.h | 1 tools/testing/radix-tree/linux/kernel.h | 29 - tools/testing/radix-tree/linux/kmemleak.h | 1 tools/testing/radix-tree/linux/local_lock.h | 8 tools/testing/radix-tree/linux/lockdep.h | 16 tools/testing/radix-tree/linux/maple_tree.h | 7 tools/testing/radix-tree/linux/percpu.h | 11 tools/testing/radix-tree/linux/preempt.h | 15 tools/testing/radix-tree/linux/radix-tree.h | 26 - tools/testing/radix-tree/linux/rcupdate.h | 12 tools/testing/radix-tree/linux/xarray.h | 2 tools/testing/radix-tree/trace/events/maple_tree.h | 5 tools/testing/radix-tree/xarray.c | 10 tools/testing/shared/autoconf.h | 2 tools/testing/shared/linux.c | 271 +++++++++++ tools/testing/shared/linux/bug.h | 2 tools/testing/shared/linux/cpu.h | 1 tools/testing/shared/linux/idr.h | 1 tools/testing/shared/linux/init.h | 2 tools/testing/shared/linux/kconfig.h | 1 tools/testing/shared/linux/kernel.h | 29 + tools/testing/shared/linux/kmemleak.h | 1 tools/testing/shared/linux/local_lock.h | 8 tools/testing/shared/linux/lockdep.h | 16 tools/testing/shared/linux/maple_tree.h | 7 tools/testing/shared/linux/percpu.h | 11 tools/testing/shared/linux/preempt.h | 15 tools/testing/shared/linux/radix-tree.h | 26 + tools/testing/shared/linux/rcupdate.h | 12 tools/testing/shared/linux/xarray.h | 2 tools/testing/shared/maple-shared.h | 9 tools/testing/shared/maple-shim.c | 7 tools/testing/shared/shared.h | 33 + tools/testing/shared/shared.mk | 72 ++ tools/testing/shared/trace/events/maple_tree.h | 5 tools/testing/shared/xarray-shared.c | 5 tools/testing/shared/xarray-shared.h | 4 45 files changed, 556 insertions(+), 481 deletions(-)
tools/testing/radix-tree/generated/autoconf.h deleted +0 -2
@@ -1,2 +0,0 @@ -#include "bit-length.h" -#define CONFIG_XARRAY_MULTI 1
tools/testing/radix-tree/.gitignore renamed from tools/testing/radix-tree/.gitignore~tools-separate-out-shared-radix-tree-components +1 -0
@@ -1,4 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only +generated/autoconf.h generated/bit-length.h generated/map-shift.h idr.c
tools/testing/radix-tree/linux/bug.h deleted +0 -2
@@ -1,2 +0,0 @@ -#include <stdio.h> -#include "asm/bug.h"
tools/testing/radix-tree/linux.c deleted +0 -271
271 lines not on this page · raw message
tools/testing/radix-tree/linux/cpu.h deleted +0 -1
@@ -1 +0,0 @@ -#define cpuhp_setup_state_nocalls (a, b, c, d) (0)
tools/testing/radix-tree/linux/idr.h deleted +0 -1
@@ -1 +0,0 @@ -#include "../../../../include/linux/idr.h"
tools/testing/radix-tree/linux/init.h deleted +0 -2
@@ -1,2 +0,0 @@ -#define __init -#define __exit
tools/testing/radix-tree/linux/kconfig.h deleted +0 -1
@@ -1 +0,0 @@ -#include "../../../../include/linux/kconfig.h"
tools/testing/radix-tree/linux/kernel.h deleted +0 -29
@@ -1,29 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _KERNEL_H -#define _KERNEL_H - -#include "../../include/linux/kernel.h" -#include <string.h> -#include <stdio.h> -#include <limits.h> - -#include <linux/compiler.h> -#include <linux/err.h> -#include <linux/bitops.h> -#include <linux/log2.h> -#include "../../../include/linux/kconfig.h" - -#define printk printf -#define pr_err printk -#define pr_info printk -#define pr_debug printk -#define pr_cont printk -#define schedule () -#define PAGE_SHIFT 12 - -#define __acquires (x) -#define __releases (x) -#define __must_hold (x) - -#define EXPORT_PER_CPU_SYMBOL_GPL (x) -#endif /* _KERNEL_H */
tools/testing/radix-tree/linux/kmemleak.h deleted +0 -1
@@ -1 +0,0 @@ -static inline void kmemleak_update_trace (const void *ptr) { }
tools/testing/radix-tree/linux/local_lock.h deleted +0 -8
@@ -1,8 +0,0 @@ -#ifndef _LINUX_LOCAL_LOCK -#define _LINUX_LOCAL_LOCK -typedef struct { }local_lock_t ; - -static inline void local_lock (local_lock_t *lock) { } -static inline void local_unlock (local_lock_t *lock) { } -#define INIT_LOCAL_LOCK (x) { } -#endif
tools/testing/radix-tree/linux/lockdep.h deleted +0 -16
@@ -1,16 +0,0 @@ -#ifndef _LINUX_LOCKDEP_H -#define _LINUX_LOCKDEP_H - -#include <linux/spinlock.h> - -struct lock_class_key { -unsigned int a; -}; - -static inline void lockdep_set_class (spinlock_t *lock, -struct lock_class_key *key) -{ -} - -extern int lockdep_is_held (const void *); -#endif /* _LINUX_LOCKDEP_H */
tools/testing/radix-tree/linux/maple_tree.h deleted +0 -7
@@ -1,7 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -#define atomic_t int32_t -#define atomic_inc (x) uatomic_inc(x) -#define atomic_read (x) uatomic_read(x) -#define atomic_set (x, y) do {} while (0) -#define U8_MAX UCHAR_MAX -#include "../../../../include/linux/maple_tree.h"
tools/testing/radix-tree/linux/percpu.h deleted +0 -11
@@ -1,11 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#define DECLARE_PER_CPU (type, val) extern type val -#define DEFINE_PER_CPU (type, val) type val - -#define __get_cpu_var (var) var -#define this_cpu_ptr (var) var -#define this_cpu_read (var) var -#define this_cpu_xchg (var, val) uatomic_xchg(&var, val) -#define this_cpu_cmpxchg (var, old, new) uatomic_cmpxchg(&var, old, new) -#define per_cpu_ptr (ptr, cpu) ({ (void)(cpu); (ptr); }) -#define per_cpu (var, cpu) (*per_cpu_ptr(&(var), cpu))
tools/testing/radix-tree/linux/preempt.h deleted +0 -15
@@ -1,15 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __LINUX_PREEMPT_H -#define __LINUX_PREEMPT_H - -extern int preempt_count; - -#define preempt_disable () uatomic_inc(&preempt_count) -#define preempt_enable () uatomic_dec(&preempt_count) - -static inline int in_interrupt (void ) -{ -return 0 ; -} - -#endif /* __LINUX_PREEMPT_H */
tools/testing/radix-tree/linux/radix-tree.h deleted +0 -26
@@ -1,26 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _TEST_RADIX_TREE_H -#define _TEST_RADIX_TREE_H - -#include "../../../../include/linux/radix-tree.h" - -extern int kmalloc_verbose; -extern int test_verbose; - -static inline void trace_call_rcu (struct rcu_head *head, -void (*func)(struct rcu_head *head)) -{ -if (kmalloc_verbose) -printf ("Delaying free of %p to slab\n" , (char *)head - - offsetof(struct radix_tree_node , rcu_head)); -call_rcu (head, func); -} - -#define printv (verbosity_level, fmt, ...) \ - if(test_verbose >= verbosity_level) \ - printf(fmt, ##__VA_ARGS__) - -#undef call_rcu -#define call_rcu (x, y) trace_call_rcu(x, y) - -#endif /* _TEST_RADIX_TREE_H */
tools/testing/radix-tree/linux/rcupdate.h deleted +0 -12
@@ -1,12 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _RCUPDATE_H -#define _RCUPDATE_H - -#include <urcu.h> - -#define rcu_dereference_raw (p) rcu_dereference(p) -#define rcu_dereference_protected (p, cond) rcu_dereference(p) -#define rcu_dereference_check (p, cond) rcu_dereference(p) -#define RCU_INIT_POINTER (p, v) do { (p) = (v); } while (0) - -#endif
tools/testing/radix-tree/linux/xarray.h deleted +0 -2
@@ -1,2 +0,0 @@ -#include "generated/map-shift.h" -#include "../../../../include/linux/xarray.h"
tools/testing/radix-tree/Makefile renamed from tools/testing/radix-tree/Makefile~tools-separate-out-shared-radix-tree-components +12 -60
89 lines not on this page · raw message
tools/testing/radix-tree/trace/events/maple_tree.h deleted +0 -5
@@ -1,5 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ - -#define trace_ma_op (a, b) do {} while (0) -#define trace_ma_read (a, b) do {} while (0) -#define trace_ma_write (a, b, c, d) do {} while (0)
tools/testing/radix-tree/xarray.c renamed from tools/testing/radix-tree/xarray.c~tools-separate-out-shared-radix-tree-components +1 -9
@@ -4,17 +4,9 @@* Copyright (c) 2018 Matthew Wilcox <[email protected]> */ -#define XA_DEBUG +#include "xarray-shared.h" #include "test.h" -#define module_init (x) -#define module_exit (x) -#define MODULE_AUTHOR (x) -#define MODULE_DESCRIPTION (X ) -#define MODULE_LICENSE (x) -#define dump_stack () assert(0) - -#include "../../../lib/xarray.c" #undef XA_DEBUG#include "../../../lib/test_xarray.c"
tools/testing/shared/autoconf.h new file +2 -0
@@ -0,0 +1,2 @@ +#include "bit-length.h" +#define CONFIG_XARRAY_MULTI 1
tools/testing/shared/linux/bug.h new file +2 -0
@@ -0,0 +1,2 @@ +#include <stdio.h> +#include "asm/bug.h"
tools/testing/shared/linux.c new file +271 -0
271 lines not on this page · raw message
tools/testing/shared/linux/cpu.h new file +1 -0
@@ -0,0 +1 @@ +#define cpuhp_setup_state_nocalls (a, b, c, d) (0)
tools/testing/shared/linux/idr.h new file +1 -0
@@ -0,0 +1 @@ +#include "../../../../include/linux/idr.h"
tools/testing/shared/linux/init.h new file +2 -0
@@ -0,0 +1,2 @@ +#define __init +#define __exit
tools/testing/shared/linux/kconfig.h new file +1 -0
@@ -0,0 +1 @@ +#include "../../../../include/linux/kconfig.h"
tools/testing/shared/linux/kernel.h new file +29 -0
@@ -0,0 +1,29 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _KERNEL_H +#define _KERNEL_H + +#include "../../include/linux/kernel.h" +#include <string.h> +#include <stdio.h> +#include <limits.h> + +#include <linux/compiler.h> +#include <linux/err.h> +#include <linux/bitops.h> +#include <linux/log2.h> +#include "../../../include/linux/kconfig.h" + +#define printk printf +#define pr_err printk +#define pr_info printk +#define pr_debug printk +#define pr_cont printk +#define schedule () +#define PAGE_SHIFT 12 + +#define __acquires (x) +#define __releases (x) +#define __must_hold (x) + +#define EXPORT_PER_CPU_SYMBOL_GPL (x) +#endif /* _KERNEL_H */
tools/testing/shared/linux/kmemleak.h new file +1 -0
@@ -0,0 +1 @@ +static inline void kmemleak_update_trace (const void *ptr) { }
tools/testing/shared/linux/local_lock.h new file +8 -0
@@ -0,0 +1,8 @@ +#ifndef _LINUX_LOCAL_LOCK +#define _LINUX_LOCAL_LOCK +typedef struct { }local_lock_t ; + +static inline void local_lock (local_lock_t *lock) { } +static inline void local_unlock (local_lock_t *lock) { } +#define INIT_LOCAL_LOCK (x) { } +#endif
tools/testing/shared/linux/lockdep.h new file +16 -0
@@ -0,0 +1,16 @@ +#ifndef _LINUX_LOCKDEP_H +#define _LINUX_LOCKDEP_H + +#include <linux/spinlock.h> + +struct lock_class_key { +unsigned int a; +}; + +static inline void lockdep_set_class (spinlock_t *lock, +struct lock_class_key *key) +{ +} + +extern int lockdep_is_held (const void *); +#endif /* _LINUX_LOCKDEP_H */
tools/testing/shared/linux/maple_tree.h new file +7 -0
@@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +#define atomic_t int32_t +#define atomic_inc (x) uatomic_inc(x) +#define atomic_read (x) uatomic_read(x) +#define atomic_set (x, y) do {} while (0) +#define U8_MAX UCHAR_MAX +#include "../../../../include/linux/maple_tree.h"
tools/testing/shared/linux/percpu.h new file +11 -0
@@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#define DECLARE_PER_CPU (type, val) extern type val +#define DEFINE_PER_CPU (type, val) type val + +#define __get_cpu_var (var) var +#define this_cpu_ptr (var) var +#define this_cpu_read (var) var +#define this_cpu_xchg (var, val) uatomic_xchg(&var, val) +#define this_cpu_cmpxchg (var, old, new) uatomic_cmpxchg(&var, old, new) +#define per_cpu_ptr (ptr, cpu) ({ (void)(cpu); (ptr); }) +#define per_cpu (var, cpu) (*per_cpu_ptr(&(var), cpu))
tools/testing/shared/linux/preempt.h new file +15 -0
@@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __LINUX_PREEMPT_H +#define __LINUX_PREEMPT_H + +extern int preempt_count; + +#define preempt_disable () uatomic_inc(&preempt_count) +#define preempt_enable () uatomic_dec(&preempt_count) + +static inline int in_interrupt (void ) +{ +return 0 ; +} + +#endif /* __LINUX_PREEMPT_H */
tools/testing/shared/linux/radix-tree.h new file +26 -0
@@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _TEST_RADIX_TREE_H +#define _TEST_RADIX_TREE_H + +#include "../../../../include/linux/radix-tree.h" + +extern int kmalloc_verbose; +extern int test_verbose; + +static inline void trace_call_rcu (struct rcu_head *head, +void (*func)(struct rcu_head *head)) +{ +if (kmalloc_verbose) +printf ("Delaying free of %p to slab\n" , (char *)head - + offsetof(struct radix_tree_node , rcu_head)); +call_rcu (head, func); +} + +#define printv (verbosity_level, fmt, ...) \ + if(test_verbose >= verbosity_level) \ + printf(fmt, ##__VA_ARGS__) + +#undef call_rcu +#define call_rcu (x, y) trace_call_rcu(x, y) + +#endif /* _TEST_RADIX_TREE_H */
tools/testing/shared/linux/rcupdate.h new file +12 -0
@@ -0,0 +1,12 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _RCUPDATE_H +#define _RCUPDATE_H + +#include <urcu.h> + +#define rcu_dereference_raw (p) rcu_dereference(p) +#define rcu_dereference_protected (p, cond) rcu_dereference(p) +#define rcu_dereference_check (p, cond) rcu_dereference(p) +#define RCU_INIT_POINTER (p, v) do { (p) = (v); } while (0) + +#endif
tools/testing/shared/linux/xarray.h new file +2 -0
@@ -0,0 +1,2 @@ +#include "generated/map-shift.h" +#include "../../../../include/linux/xarray.h"
tools/testing/shared/maple-shared.h new file +9 -0
@@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ + +#define CONFIG_DEBUG_MAPLE_TREE +#define CONFIG_MAPLE_SEARCH +#define MAPLE_32BIT (MAPLE_NODE_SLOTS > 31) +#include "shared.h" +#include <stdlib.h> +#include <time.h> +#include "linux/init.h"
tools/testing/shared/maple-shim.c new file +7 -0
@@ -0,0 +1,7 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +/* Very simple shim around the maple tree. */ + +#include "maple-shared.h" + +#include "../../../lib/maple_tree.c"
tools/testing/shared/shared.h new file +33 -0
@@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#include <linux/types.h> +#include <linux/bug.h> +#include <linux/kernel.h> +#include <linux/bitops.h> + +#include <linux/gfp.h> +#include <linux/rcupdate.h> + +#ifndef module_init +#define module_init (x) +#endif + +#ifndef module_exit +#define module_exit (x) +#endif + +#ifndef MODULE_AUTHOR +#define MODULE_AUTHOR (x) +#endif + +#ifndef MODULE_LICENSE +#define MODULE_LICENSE (x) +#endif + +#ifndef MODULE_DESCRIPTION +#define MODULE_DESCRIPTION (x) +#endif + +#ifndef dump_stack +#define dump_stack () assert(0) +#endif
tools/testing/shared/shared.mk new file +72 -0
72 lines not on this page · raw message
tools/testing/shared/trace/events/maple_tree.h new file +5 -0
@@ -0,0 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ + +#define trace_ma_op (a, b) do {} while (0) +#define trace_ma_read (a, b) do {} while (0) +#define trace_ma_write (a, b, c, d) do {} while (0)
tools/testing/shared/xarray-shared.c new file +5 -0
@@ -0,0 +1,5 @@ +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "xarray-shared.h" + +#include "../../../lib/xarray.c"
tools/testing/shared/xarray-shared.h new file +4 -0
@@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ + +#define XA_DEBUG +#include "shared.h"
_
Patches currently in -mm which might be from [email protected] are
tools-improve-vma-test-makefile.patch tools-add-vma-merge-tests.patch mm-introduce-vma_merge_struct-and-abstract-vma_mergevma_modify.patch mm-remove-duplicated-open-coded-vma-policy-check.patch mm-abstract-vma_expand-to-use-vma_merge_struct.patch mm-avoid-using-vma_merge-for-new-vmas.patch mm-make-vma_prepare-and-friends-static-and-internal-to-vmac.patch mm-introduce-commit_merge-abstracting-final-commit-of-merge.patch mm-refactor-vma_merge-into-modify-only-vma_merge_existing_range.patch mm-rework-vm_ops-close-handling-on-vma-merge.patch