/* Reload the stall detector counter register every * `ping_timeout_ms` to prevent the virtual device * from decrementing it to 0. The virtual device decrements this * register at 'clock_freq_hz' frequency.
*/
ticks = vcpu_stall_config.clock_freq_hz *
vcpu_stall_config.stall_timeout_sec;
vcpu_stall_reg_write(smp_processor_id(),
VCPU_STALL_REG_LOAD_CNT, ticks);
/* Compute the number of ticks required for the stall detector * counter register based on the internal clock frequency and the * timeout value given from the device tree.
*/
ticks = vcpu_stall_config.clock_freq_hz *
vcpu_stall_config.stall_timeout_sec;
vcpu_stall_reg_write(cpu, VCPU_STALL_REG_LOAD_CNT, ticks);
/* Enable the internal clock and start the stall detector */
vcpu_stall_reg_write(cpu, VCPU_STALL_REG_STATUS, 1);
/* Pet the stall detector at half of its expiration timeout * to prevent spurious resets.
*/
ping_timeout_ms = vcpu_stall_config.stall_timeout_sec *
MSEC_PER_SEC / 2;
if (!vcpu_stall_detector->is_initialized) return 0;
/* Disable the stall detector for the current CPU */
hrtimer_cancel(&vcpu_stall_detector->vcpu_hrtimer);
vcpu_stall_reg_write(cpu, VCPU_STALL_REG_STATUS, 0);
vcpu_stall_detector->is_initialized = false;
irq = platform_get_irq_optional(pdev, 0); if (irq > 0) {
ret = request_percpu_irq(irq,
vcpu_stall_detector_irq, "vcpu_stall_detector",
vcpu_stall_detectors); if (ret) goto err;
vcpu_stall_config.ppi_irq = irq;
}
ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "virt/vcpu_stall_detector:online",
start_stall_detector_cpu,
stop_stall_detector_cpu); if (ret < 0) {
dev_err(&pdev->dev, "failed to install cpu hotplug"); goto err;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.