credit2: avoid picking a spurious idle unit when caps are used
authorDario Faggioli <dfaggioli@suse.com>
Tue, 10 Aug 2021 07:29:10 +0000 (09:29 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 10 Aug 2021 07:29:10 +0000 (09:29 +0200)
commit0f742839ae57e10687e7a573070c37430f31068c
treee0b93e6467ba7d855a22f77cace60eae7d92746c
parent107be709150eb900c64b31c2b1a0d4b6ff0075c9
credit2: avoid picking a spurious idle unit when caps are used

Commit 07b0eb5d0ef0 ("credit2: make sure we pick a runnable unit from the
runq if there is one") did not fix completely the problem of potentially
selecting a scheduling unit that will then not be able to run.

In fact, in case caps are used and the unit we are currently looking
at, during the runqueue scan, does not have enough budget for being run,
we should continue looking instead than giving up and picking the idle
unit.

Suggested-by: George Dunlap <george.dunlap@citrix.com>
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/common/sched/credit2.c