fs/proc/softirqs.c
Source file repositories/reference/linux-study-clean/fs/proc/softirqs.c
File Facts
- System
- Linux kernel
- Corpus path
fs/proc/softirqs.c- Extension
.c- Size
- 840 bytes
- Lines
- 38
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/init.hlinux/kernel_stat.hlinux/proc_fs.hlinux/seq_file.hinternal.h
Detected Declarations
function show_softirqsfunction proc_softirqs_initmodule init proc_softirqs_init
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
#include <linux/init.h>
#include <linux/kernel_stat.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include "internal.h"
/*
* /proc/softirqs ... display the number of softirqs
*/
static int show_softirqs(struct seq_file *p, void *v)
{
int i, j;
seq_puts(p, " ");
for_each_possible_cpu(i)
seq_printf(p, "CPU%-8d", i);
seq_putc(p, '\n');
for (i = 0; i < NR_SOFTIRQS; i++) {
seq_printf(p, "%12s:", softirq_to_name[i]);
for_each_possible_cpu(j)
seq_put_decimal_ull_width(p, " ", kstat_softirqs_cpu(i, j), 10);
seq_putc(p, '\n');
}
return 0;
}
static int __init proc_softirqs_init(void)
{
struct proc_dir_entry *pde;
pde = proc_create_single("softirqs", 0, NULL, show_softirqs);
pde_make_permanent(pde);
return 0;
}
fs_initcall(proc_softirqs_init);
Annotation
- Immediate include surface: `linux/init.h`, `linux/kernel_stat.h`, `linux/proc_fs.h`, `linux/seq_file.h`, `internal.h`.
- Detected declarations: `function show_softirqs`, `function proc_softirqs_init`, `module init proc_softirqs_init`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- 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.