tools/testing/radix-tree/maple.c
Source file repositories/reference/linux-study-clean/tools/testing/radix-tree/maple.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/radix-tree/maple.c- Extension
.c- Size
- 1386933 bytes
- Lines
- 36518
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
test.h../shared/maple-shim.c../../../lib/test_maple_tree.c
Detected Declarations
struct rcu_test_struct2struct rcu_test_struct3struct rcu_reader_structstruct rcu_test_structfunction Copyrightfunction check_erasefunction check_erase_testsetfunction mas_ce2_over_countfunction mas_node_walkfunction mas_descend_walkfunction mas_tree_walkfunction check_erase2_testsetfunction mt_for_eachfunction mas_for_eachfunction check_erase2_setsfunction rcu_reader_registerfunction rcu_reader_setupfunction mas_for_eachfunction rcu_stress_revfunction rcu_stress_fwdfunction rcu_stressfunction eval_rcu_entryfunction rcu_valfunction rcu_loopfunction mas_for_eachfunction run_check_rcufunction run_check_rcu_slot_storefunction run_check_rcu_slowreadfunction check_rcu_simulatedfunction check_rcu_threadedfunction mas_dfs_preorderfunction check_dfs_preorderfunction get_vacant_heightfunction mas_allocatedfunction check_preallocfunction check_spanning_writefunction check_null_expandfunction check_nomemfunction check_lockyfunction compare_nodefunction compare_treefunction mas_subtree_max_rangefunction mas_for_eachfunction build_full_treefunction check_erase_rebalancefunction check_mtree_dupfunction check_spanning_store_heightfunction check_collapsing_rebalance
Annotated Snippet
#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 "test.h"
#include "../shared/maple-shim.c"
#include "../../../lib/test_maple_tree.c"
#define RCU_RANGE_COUNT 1000
#define RCU_MT_BUG_ON(test, y) {if (y) { test->stop = true; } MT_BUG_ON(test->mt, y); }
struct rcu_test_struct2 {
struct maple_tree *mt;
bool start;
bool stop;
unsigned int thread_count;
unsigned int seen_toggle;
unsigned int seen_added;
unsigned int seen_modified;
unsigned int seen_deleted;
int pause;
unsigned long index[RCU_RANGE_COUNT];
unsigned long last[RCU_RANGE_COUNT];
pthread_mutex_t dump;
};
struct rcu_test_struct3 {
struct maple_tree *mt;
unsigned long index;
unsigned long last;
bool stop;
};
struct rcu_reader_struct {
unsigned int id;
int mod;
int del;
int flip;
int add;
int next;
struct rcu_test_struct2 *test;
};
/*
* Check erasing including RCU.
*/
static noinline void __init check_erase(struct maple_tree *mt, unsigned long index,
void *ptr)
{
MT_BUG_ON(mt, mtree_test_erase(mt, index) != ptr);
}
#define erase_check_load(mt, i) check_load(mt, set[i], entry[i%2])
#define erase_check_insert(mt, i) check_insert(mt, set[i], entry[i%2])
#define erase_check_erase(mt, i) check_erase(mt, set[i], entry[i%2])
static noinline void __init check_erase_testset(struct maple_tree *mt)
{
static const unsigned long set[] = { 5015, 5014, 5017, 25, 1000,
1001, 1002, 1003, 1005, 0,
6003, 6002, 6008, 6012, 6015,
7003, 7002, 7008, 7012, 7015,
8003, 8002, 8008, 8012, 8015,
9003, 9002, 9008, 9012, 9015,
10003, 10002, 10008, 10012, 10015,
11003, 11002, 11008, 11012, 11015,
12003, 12002, 12008, 12012, 12015,
13003, 13002, 13008, 13012, 13015,
14003, 14002, 14008, 14012, 14015,
15003, 15002, 15008, 15012, 15015,
};
void *ptr = &check_erase_testset;
void *entry[2] = { ptr, mt };
void *root_node;
rcu_register_thread();
mt_set_in_rcu(mt);
for (int i = 0; i < 4; i++)
erase_check_insert(mt, i);
for (int i = 0; i < 4; i++)
Annotation
- Immediate include surface: `test.h`, `../shared/maple-shim.c`, `../../../lib/test_maple_tree.c`.
- Detected declarations: `struct rcu_test_struct2`, `struct rcu_test_struct3`, `struct rcu_reader_struct`, `struct rcu_test_struct`, `function Copyright`, `function check_erase`, `function check_erase_testset`, `function mas_ce2_over_count`, `function mas_node_walk`, `function mas_descend_walk`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.