cpu-hotplug: Always use real time scheduling when hotplugging a CPU
CPU hotplug operations take place in preemptible context. This leaves the hotplugging thread at the mercy of overall system load and CPU availability. If the hotplugging thread does not get an opportunity to execute after it has already begun a hotplug operation, CPUs can end up being stuck in a quasi online state. In the worst case a CPU can be stuck in a state where the migration thread is parked while another task is executing and changing affinity in a loop. This combination can result in unbounded execution time for the running task until the hotplugging thread gets the chance to run to complete the hotplug operation. Fix the said problem by ensuring that hotplug can only occur from threads belonging to the RT sched class. This allows the hotplugging thread priority on the CPU no matter what the system load or the number of available CPUs are. If a SCHED_NORMAL task attempts to hotplug a CPU, we temporarily elevate it's scheduling policy to RT. Furthermore, we disallow hotplugging operations to begin if the calling task belongs to the idle and deadline classes or those that use the SCHED_BATCH policy. Change-Id: Idbb1384626e6ddff46c0d2ce752eee68396c78af Signed-off-by:Syed Rameez Mustafa <rameezmustafa@codeaurora.org> [psodagud@codeaurora.org: Fixed compilation issues] Signed-off-by:
Prasad Sodagudi <psodagud@codeaurora.org> Signed-off-by:
Venkata Narendra Kumar Gutta <vnkgutta@codeaurora.org>
Loading
Please register or sign in to comment