commit ea8117478918a4734586d35ff530721b682425be upstream.
Mike reported that commit 7d1a9417 ("x86: Use generic idle loop")
regressed several workloads and caused excessive reschedule
The patch in question failed to notice that the x86 code had an
inverted sense of the polling state versus the new generic code (x86:
default polling, generic: default !polling).
Fix the two prominent x86 mwait based idle drivers and introduce a few
new generic polling helpers (fixing the wrong smp_mb__after_clear_bit
Also switch the idle routines to using tif_need_resched() which is an
immediate TIF_NEED_RESCHED test as opposed to need_resched which will
end up being slightly different.
Reported-by: Mike Galbraith <firstname.lastname@example.org>
Signed-off-by: Peter Zijlstra <email@example.com>
Link: http://firstname.lastname@example.orgSigned-off-by: Ingo Molnar <email@example.com>
Signed-off-by: Greg Kroah-Hartman <firstname.lastname@example.org>