kernel/time/tick-broadcast.c
Source file repositories/reference/linux-study-clean/kernel/time/tick-broadcast.c
File Facts
- System
- Linux kernel
- Corpus path
kernel/time/tick-broadcast.c- Extension
.c- Size
- 34656 bytes
- Lines
- 1249
- Domain
- Core OS
- Bucket
- Scheduler, Processes, Timers, Sync, And Syscalls
- Inferred role
- Core OS: exported/initcall integration point
- Status
- integration 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.
- 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
linux/cpu.hlinux/err.hlinux/hrtimer.hlinux/interrupt.hlinux/percpu.hlinux/profile.hlinux/sched.hlinux/smp.hlinux/module.htick-internal.h
Detected Declarations
function tick_broadcast_setup_oneshotfunction tick_broadcast_clear_oneshotfunction tick_broadcast_start_periodicfunction tick_check_broadcast_devicefunction tick_oneshot_wakeup_handlerfunction tick_set_oneshot_wakeup_devicefunction tick_set_oneshot_wakeup_devicefunction tick_install_broadcast_devicefunction tick_is_broadcast_devicefunction tick_broadcast_update_freqfunction err_broadcastfunction tick_device_setup_broadcast_funcfunction tick_device_uses_broadcastfunction tick_receive_broadcastfunction tick_do_broadcastfunction tick_do_periodic_broadcastfunction tick_handle_periodic_broadcastfunction tick_broadcast_controlfunction tick_set_periodic_handlerfunction tick_shutdown_broadcastfunction tick_broadcast_offlinefunction tick_suspend_broadcastfunction tick_resume_localfunction tick_resume_broadcastfunction tick_broadcast_oneshot_controlfunction tick_broadcast_set_affinityfunction tick_broadcast_set_eventfunction tick_resume_broadcast_oneshotfunction irq_enterfunction tick_handle_oneshot_broadcastfunction broadcast_needs_cpufunction broadcast_shutdown_localfunction ___tick_broadcast_oneshot_controlfunction tick_oneshot_wakeup_controlfunction __tick_broadcast_oneshot_controlfunction tick_broadcast_clear_oneshotfunction tick_broadcast_init_next_eventfunction for_each_cpufunction tick_get_next_periodfunction tick_broadcast_setup_oneshotfunction hrtimer_run_queuesfunction tick_broadcast_enterfunction tick_broadcast_switch_to_oneshotfunction hotplug_cpu__broadcast_tick_pullfunction tick_broadcast_oneshot_offlinefunction tick_broadcast_oneshot_activefunction tick_broadcast_oneshot_availablefunction __tick_broadcast_oneshot_control
Annotated Snippet
static inline void tick_broadcast_clear_oneshot(int cpu) { }
static inline void tick_resume_broadcast_oneshot(struct clock_event_device *bc) { }
# ifdef CONFIG_HOTPLUG_CPU
static inline void tick_broadcast_oneshot_offline(unsigned int cpu) { }
# endif
#endif
/*
* Debugging: see timer_list.c
*/
struct tick_device *tick_get_broadcast_device(void)
{
return &tick_broadcast_device;
}
struct cpumask *tick_get_broadcast_mask(void)
{
return tick_broadcast_mask;
}
static struct clock_event_device *tick_get_oneshot_wakeup_device(int cpu);
const struct clock_event_device *tick_get_wakeup_device(int cpu)
{
return tick_get_oneshot_wakeup_device(cpu);
}
/*
* Start the device in periodic mode
*/
static void tick_broadcast_start_periodic(struct clock_event_device *bc)
{
if (bc) {
bc->next_event_forced = 0;
tick_setup_periodic(bc, 1);
}
}
/*
* Check, if the device can be utilized as broadcast device:
*/
static bool tick_check_broadcast_device(struct clock_event_device *curdev,
struct clock_event_device *newdev)
{
if ((newdev->features & CLOCK_EVT_FEAT_DUMMY) ||
(newdev->features & CLOCK_EVT_FEAT_PERCPU) ||
(newdev->features & CLOCK_EVT_FEAT_C3STOP))
return false;
if (tick_broadcast_device.mode == TICKDEV_MODE_ONESHOT &&
!(newdev->features & CLOCK_EVT_FEAT_ONESHOT))
return false;
return !curdev || newdev->rating > curdev->rating;
}
#ifdef CONFIG_TICK_ONESHOT
static struct clock_event_device *tick_get_oneshot_wakeup_device(int cpu)
{
return per_cpu(tick_oneshot_wakeup_device, cpu);
}
static void tick_oneshot_wakeup_handler(struct clock_event_device *wd)
{
wd->next_event_forced = 0;
/*
* If we woke up early and the tick was reprogrammed in the
* meantime then this may be spurious but harmless.
*/
tick_receive_broadcast();
}
static bool tick_set_oneshot_wakeup_device(struct clock_event_device *newdev,
int cpu)
{
struct clock_event_device *curdev = tick_get_oneshot_wakeup_device(cpu);
if (!newdev)
goto set_device;
if ((newdev->features & CLOCK_EVT_FEAT_DUMMY) ||
(newdev->features & CLOCK_EVT_FEAT_C3STOP))
return false;
if (!(newdev->features & CLOCK_EVT_FEAT_PERCPU) ||
!(newdev->features & CLOCK_EVT_FEAT_ONESHOT))
return false;
if (!cpumask_equal(newdev->cpumask, cpumask_of(cpu)))
return false;
Annotation
- Immediate include surface: `linux/cpu.h`, `linux/err.h`, `linux/hrtimer.h`, `linux/interrupt.h`, `linux/percpu.h`, `linux/profile.h`, `linux/sched.h`, `linux/smp.h`.
- Detected declarations: `function tick_broadcast_setup_oneshot`, `function tick_broadcast_clear_oneshot`, `function tick_broadcast_start_periodic`, `function tick_check_broadcast_device`, `function tick_oneshot_wakeup_handler`, `function tick_set_oneshot_wakeup_device`, `function tick_set_oneshot_wakeup_device`, `function tick_install_broadcast_device`, `function tick_is_broadcast_device`, `function tick_broadcast_update_freq`.
- Atlas domain: Core OS / Scheduler, Processes, Timers, Sync, And Syscalls.
- 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.