arch/s390/include/asm/vtime.h
Source file repositories/reference/linux-study-clean/arch/s390/include/asm/vtime.h
File Facts
- System
- Linux kernel
- Corpus path
arch/s390/include/asm/vtime.h- Extension
.h- Size
- 1791 bytes
- Lines
- 58
- Domain
- Architecture Layer
- Bucket
- arch/s390
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
asm/lowcore.hasm/cpu_mf.hasm/idle.h
Detected Declarations
function update_timer_sysfunction update_timer_mcckfunction update_timer_idle
Annotated Snippet
#ifndef _S390_VTIME_H
#define _S390_VTIME_H
#include <asm/lowcore.h>
#include <asm/cpu_mf.h>
#include <asm/idle.h>
DECLARE_PER_CPU(u64, mt_cycles[8]);
static inline void update_timer_sys(void)
{
struct lowcore *lc = get_lowcore();
lc->system_timer += lc->last_update_timer - lc->exit_timer;
lc->user_timer += lc->exit_timer - lc->sys_enter_timer;
lc->last_update_timer = lc->sys_enter_timer;
}
static inline void update_timer_mcck(void)
{
struct lowcore *lc = get_lowcore();
lc->system_timer += lc->last_update_timer - lc->exit_timer;
lc->user_timer += lc->exit_timer - lc->mcck_enter_timer;
lc->last_update_timer = lc->mcck_enter_timer;
}
static inline void update_timer_idle(void)
{
struct s390_idle_data *idle = this_cpu_ptr(&s390_idle);
struct lowcore *lc = get_lowcore();
u64 cycles_new[8];
int i, mtid;
mtid = smp_cpu_mtid;
if (mtid) {
stcctm(MT_DIAG, mtid, cycles_new);
for (i = 0; i < mtid; i++)
__this_cpu_add(mt_cycles[i], cycles_new[i] - idle->mt_cycles_enter[i]);
}
/*
* This is a bit subtle: Forward last_update_clock so it excludes idle
* time. For correct steal time calculation in do_account_vtime() add
* passed wall time before idle_enter to steal_timer:
* During the passed wall time before idle_enter CPU time may have
* been accounted to system, hardirq, softirq, etc. lowcore fields.
* The accounted CPU times will be subtracted again from steal_timer
* when accumulated steal time is calculated in do_account_vtime().
*/
lc->steal_timer += idle->clock_idle_enter.tod - lc->last_update_clock;
lc->last_update_clock = lc->int_clock.tod;
lc->system_timer += lc->last_update_timer - idle->timer_idle_enter;
lc->last_update_timer = lc->sys_enter_timer;
}
#endif /* _S390_VTIME_H */
Annotation
- Immediate include surface: `asm/lowcore.h`, `asm/cpu_mf.h`, `asm/idle.h`.
- Detected declarations: `function update_timer_sys`, `function update_timer_mcck`, `function update_timer_idle`.
- Atlas domain: Architecture Layer / arch/s390.
- 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.