Re: [PATCH 2/4] sched: cpufreq: Keep track of cpufreq utilization update flags

From: Peter Zijlstra
Date: Wed Dec 20 2017 - 04:17:43 EST


On Wed, Dec 20, 2017 at 02:18:59PM +0530, Viresh Kumar wrote:
> On 20-12-17, 09:31, Peter Zijlstra wrote:
> What about this case: A CFS task is running currently and an RT task
> is enqueued.
>
> - Is it always the case that the CFS task is preempted immediately and
> the CPU is given to RT task ? I was talking to Vincent earlier and
> he told me that for certain configurations the CFS task may keep
> running until the next tick.
>
> - What if the CFS task has disabled preemption ?
>
> - More corner cases like this ?

If there is a runnable RT task we'll schedule to it ASAP. This means
for:

CONFIG_PREEMPT=y

either immediately or when next preempt_enable() hits a 0
preempt_count.

CONFIG_PREEMPT=n

on any next kernel preemption point or when returning to userspace.

But this is not something we should worry about.