credit2: make sure we pick a runnable unit from the runq if there is one
authorDario Faggioli <dfaggioli@suse.com>
Thu, 15 Jul 2021 07:29:34 +0000 (09:29 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 15 Jul 2021 07:29:34 +0000 (09:29 +0200)
commitecd6b1770ff7a3e7b9f13013fc661790b553a743
treecb390077f6d67cd480d4715b23ca12f3d9f05c78
parentc6ee6d4ec3c87d67e8fee58e28459c22c44b384b
credit2: make sure we pick a runnable unit from the runq if there is one

A !runnable unit (temporarily) present in the runq may cause us to
stop scanning the runq itself too early. Of course, we don't run any
non-runnable vCPUs, but we end the scan and we fallback to picking
the idle unit. In other word, this prevent us to find there and pick
the actual unit that we're meant to start running (which might be
further ahead in the runq).

Depending on the vCPU pinning configuration, this may lead to such
unit to be stuck in the runq for long time, causing malfunctioning
inside the guest.

Fix this by checking runnable/non-runnable status up-front, in the runq
scanning function.

Reported-by: Michał Leszczyński <michal.leszczynski@cert.pl>
Reported-by: Dion Kant <g.w.kant@hunenet.nl>
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
master commit: 07b0eb5d0ef0be154606aa46b5b4c5c59b158505
master date: 2021-06-07 13:16:36 +0100
xen/common/sched/credit2.c