ANDROID: Add MPAM prototype
Android already provides us with a task classification through the means of cgroups, namely cpusets (background, foreground, top-app). This sounds promising for driving MPAM PARTIDs based on which cgroup a CPU's current task belongs to. The module leverages two vendor hooks: o is_fpsimd_save(), to update the MPAM register at context switch time o mpam_hook_attach(), to detect if a running task is changing cgroups and force an MPAM register synchronization. An additional synchronization happens at the module load (to synchronize with tasks already present in the cgroups) and at unload (to reset the PARTID to a sane default). The cgroup path -> PARTID mapping is saved as a simple and stupid array (because this is a prototype :-)). It is further cached as a cgroup_subsys_state.id -> PARTID map (the id is unique per cgroup subsystem). The smp_call scheme is heavily inspired by the following commit: ae28d1aa ("x86/resctrl: Use an IPI instead of task_work_add() to update PQR_ASSOC MSR") Place the module into kernel/sched to leverage the 'runqueues' symbols and its associated sched.h helpers. Signed-off-by:Valentin Schneider <valentin.schneider@arm.com>
Loading
Please register or sign in to comment