内存带宽控制 论文题目:Supporting Temporal and Spatial Isolation in a Hypervisor for ARM Multicore Platforms
项目代码:https://github.com/pa007/xvisor-next/tree/cache-coloring_and_memory-reservation
CONFIG_MEMORY_RESERVATION 解决这个问题的一种简单实用的技术是实现一种内存带宽预留机制,该机制限制给定时间窗口内的内存访问次数,这可能是 Yun 在非虚拟化背景下首次提出的基于软件的解决方案多处理器系统。
Hypervisor上怎么做?给每个vcpu一个内存访问预算budget,并周期性补充;这些信息都是静态配置的;
这种方法可以减少VM由于内存争用而引起的干扰,内存争用会隐式地受到内存预算的限制,并且独立于在其他VM内运行的软件的实际行为。
Intel RDT & ARM MPAM https://cloud-atlas.readthedocs.io/zh_CN/latest/kernel/cpu/intel/intel_rdt/intel_rdt_arch.html
MBA (Memory Bandwidth Allocation):https://www.intel.com/content/www/us/en/developer/articles/technical/introduction-to-memory-bandwidth-allocation.html
Xen上的一个文档:https://xenbits.xen.org/docs/unstable/features/intel_psr_mba.html
Xen对intel QoS的处理:https://wiki.xenproject.org/wiki/Intel_Platform_QoS_Technologies
ARM MPAM的寄存器:https://developer.arm.com/documentation/ddi0595/2021-12/External-Registers/MPAMCFG-MBW-MAX–MPAM-Memory-Bandwidth-Maximum-Partition-Configuration-Register
ARM上应该怎么做获取内存访问的budget? 通过PMU,可以记录到data memory access的数量,使用硬件功能,减少软件记录的开销。
PMU还可以产生中断,当某个寄存器溢出的时候,这可以用来消耗预算,避免了软件对预算的反复检查。
研究一下ARM PMU
tx2的pmu版本:pmuv3
文档:https://developer.arm.com/documentation/ddi0488/h/performance-monitor-unit?lang=en
一个博客,看/proc/interrupt看看pmu的中断https://www.whexy.com/posts/PMU
cp15寄存器:https://developer.arm.com/documentation/ddi0406/b/Debug-Architecture/Performance-Monitors/CP15-c9-register-map?lang=en
怎么控制内存带宽? 通过vcpu调度
PMU驱动 所有寄存器 armv8 aarch64 PMU寄存器介绍
PMCR_EL0 Performance Monitors Control Register 控制寄存器 PMCCFILTR_EL0 Performance Monitors Cycle Count Filter Register 过滤器 PMCCNTR_EL0 Performance Monitors Cycle Count Register 时钟周期数 PMCEID0_EL0 Performance Monitors Common Event Identification register 0 检查某个event有没有实现,只读 PMCEID1_EL0 Performance Monitors Common Event Identification register 1 PMCNTENCLR_EL0 Performance Monitors Count Enable Clear register counter使能 PMCNTENSET_EL0 Performance Monitors Count Enable Set register PMEVCNTR_EL0 Performance Monitors Event Count Registers 各类事件的计数 PMEVTYPER_EL0 Performance Monitors Event Type Registers 寄存器对应事件类型 PMINTENCLR_EL1 Performance Monitors Interrupt Enable Clear register 中断 PMINTENSET_EL1 Performance Monitors Interrupt Enable Set register PMOVSCLR_EL0 Performance Monitors Overflow Flag Status Clear Register 溢出状态 PMOVSSET_EL0 Performance Monitors Overflow Flag Status Set register PMSWINC_EL0 Performance Monitors Software Increment register 写这个寄存器可以使某个counter加一 PMUSERENR_EL0 Performance Monitors User Enable Register 设置用户态权限 PMSELR_EL0 Performance Monitors Event Counter Selection Register 选择寄存器 PMXEVCNTR_EL0 Performance Monitors Selected Event Count Register 写入PMSELR_EL0寄存器后对应的值 PMXEVTYPER_EL0 Performance Monitors Selected Event Type Register 设置PMCR_EL0寄存器,控制是否记录EL0, EL1, EL2, EL3的事件;...