• Tobias Huschle's avatar
    s390/wti: Prepare graceful CPU pre-emption on wti reception · cafeff5a
    Tobias Huschle authored
    When a warning track interrupt is received, the kernel has only a very
    limited amount of time to make sure, that the CPU can be yielded as
    gracefully as possible before being pre-empted by the hypervisor.
    
    The interrupt handler for the wti therefore unparks a kernel thread
    which has being created on boot re-using the CPU hotplug kernel thread
    infrastructure. These threads exist per CPU and are assigned the
    highest possible real-time priority. This makes sure, that said threads
    will execute as soon as possible as the scheduler should pre-empt any
    other running user tasks to run the real-time thread.
    
    Furthermore, the interrupt handler disables all I/O interrupts to
    prevent additional interrupt processing on the soon-preempted CPU.
    Interrupt handlers are likely to take kernel locks, which in the worst
    case, will be kept while the interrupt handler is pre-empted from itself
    underlying physical CPU. In that case, all tasks or interrupt handlers
    on other CPUs would have to wait for the pre-empted CPU being dispatched
    again. By preventing further interrupt processing, this risk is
    minimized.
    
    Once the CPU gets dispatched again, the real-time kernel thread regains
    control, reenables interrupts and parks itself again.
    Acked-by: default avatarHeiko Carstens <hca@linux.ibm.com>
    Reviewed-by: default avatarMete Durlu <meted@linux.ibm.com>
    Signed-off-by: default avatarTobias Huschle <huschle@linux.ibm.com>
    Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
    cafeff5a
wti.c 3.22 KB