Re: [PATCH RFC v3 3/6] sched/idle: Add a generic poll before enter real idle path

From: Thomas Gleixner
Date: Thu Nov 16 2017 - 04:53:54 EST


On Thu, 16 Nov 2017, Quan Xu wrote:
> On 2017-11-16 06:03, Thomas Gleixner wrote:
> --- a/drivers/cpuidle/cpuidle.c
> +++ b/drivers/cpuidle/cpuidle.c
> @@ -210,6 +210,13 @@ int cpuidle_enter_state(struct cpuidle_device *dev,
> struct cpuidle_driver *drv,
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ target_state = &drv->states[index];
> ÂÂÂÂÂÂÂ }
>
> +#ifdef CONFIG_PARAVIRT
> +ÂÂÂÂÂÂ paravirt_idle_poll();
> +
> +ÂÂÂÂÂÂ if (need_resched())
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ return -EBUSY;
> +#endif

That's just plain wrong. We don't want to see any of this PARAVIRT crap in
anything outside the architecture/hypervisor interfacing code which really
needs it.

The problem can and must be solved at the generic level in the first place
to gather the data which can be used to make such decisions.

How that information is used might be either completely generic or requires
system specific variants. But as long as we don't have any information at
all we cannot discuss that.

Please sit down and write up which data needs to be considered to make
decisions about probabilistic polling. Then we need to compare and contrast
that with the data which is necessary to make power/idle state decisions.

I would be very surprised if this data would not overlap by at least 90%.

Thanks,

tglx