tools/testing/selftests/powerpc/mm/tlbie_test.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/powerpc/mm/tlbie_test.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/powerpc/mm/tlbie_test.c- Extension
.c- Size
- 20241 bytes
- Lines
- 734
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
stdio.hsys/mman.hsys/types.hsys/wait.hsys/ipc.hsys/shm.hsys/stat.hsys/time.hlinux/futex.hunistd.hasm/unistd.hstring.hstdlib.hfcntl.hsched.htime.hstdarg.hpthread.hsignal.hsys/prctl.h
Detected Declarations
function sched_yieldfunction err_msgfunction compute_word_offsetfunction performedfunction extract_tidfunction extract_word_offsetfunction extract_sweep_idfunction start_verification_logfunction log_anamolyfunction end_verification_logfunction verify_chunkfunction set_pthread_cpufunction set_mycpufunction segv_handlerfunction set_segv_handlerfunction alrm_sighandlerfunction main
Annotated Snippet
if (iter_ptr < next_store_addr) {
expected_sweep_id = cur_sweep_id;
} else {
expected_sweep_id = prev_sweep_id;
}
expected = compute_store_pattern(tid, iter_ptr, expected_sweep_id);
dcbf((volatile unsigned int*)iter_ptr); //Flush before reading
observed = *iter_ptr;
if (observed != expected) {
nr_anamolies++;
log_anamoly(tid, iter_ptr, expected, observed);
}
}
end_verification_log(tid, nr_anamolies);
}
static void set_pthread_cpu(pthread_t th, int cpu)
{
cpu_set_t run_cpu_mask;
struct sched_param param;
CPU_ZERO(&run_cpu_mask);
CPU_SET(cpu, &run_cpu_mask);
pthread_setaffinity_np(th, sizeof(cpu_set_t), &run_cpu_mask);
param.sched_priority = 1;
if (0 && sched_setscheduler(0, SCHED_FIFO, ¶m) == -1) {
/* haven't reproduced with this setting, it kills random preemption which may be a factor */
fprintf(stderr, "could not set SCHED_FIFO, run as root?\n");
}
}
static void set_mycpu(int cpu)
{
cpu_set_t run_cpu_mask;
struct sched_param param;
CPU_ZERO(&run_cpu_mask);
CPU_SET(cpu, &run_cpu_mask);
sched_setaffinity(0, sizeof(cpu_set_t), &run_cpu_mask);
param.sched_priority = 1;
if (0 && sched_setscheduler(0, SCHED_FIFO, ¶m) == -1) {
fprintf(stderr, "could not set SCHED_FIFO, run as root?\n");
}
}
static volatile int segv_wait;
static void segv_handler(int signo, siginfo_t *info, void *extra)
{
while (segv_wait) {
sched_yield();
}
}
static void set_segv_handler(void)
{
struct sigaction sa;
sa.sa_flags = SA_SIGINFO;
sa.sa_sigaction = segv_handler;
if (sigaction(SIGSEGV, &sa, NULL) == -1) {
perror("sigaction");
exit(EXIT_FAILURE);
}
}
int timeout = 0;
/*
* This function is executed by every rim_thread.
*
* This function performs sweeps over the exclusive chunks of the
* rim_threads executing the rim-sequence one word at a time.
*/
static void *rim_fn(void *arg)
{
unsigned int tid = *((unsigned int *)arg);
int size = RIM_CHUNK_SIZE;
char *chunk_start = compute_chunk_start_addr(tid);
unsigned int prev_sweep_id;
unsigned int cur_sweep_id = 0;
Annotation
- Immediate include surface: `stdio.h`, `sys/mman.h`, `sys/types.h`, `sys/wait.h`, `sys/ipc.h`, `sys/shm.h`, `sys/stat.h`, `sys/time.h`.
- Detected declarations: `function sched_yield`, `function err_msg`, `function compute_word_offset`, `function performed`, `function extract_tid`, `function extract_word_offset`, `function extract_sweep_id`, `function start_verification_log`, `function log_anamoly`, `function end_verification_log`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
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.