diff mbox series

[4/9] xen/sched: remove special cases for free cpus in schedulers

Message ID 20191218074859.21665-5-jgross@suse.com (mailing list archive)
State Superseded
Headers show
Series xen: scheduler cleanups | expand

Commit Message

Jürgen Groß Dec. 18, 2019, 7:48 a.m. UTC
With the idle scheduler now taking care of all cpus not in any cpupool
the special cases in the other schedulers for no cpupool associated
can be removed.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
 xen/common/sched/sched_credit.c  |  7 ++-----
 xen/common/sched/sched_credit2.c | 30 ------------------------------
 2 files changed, 2 insertions(+), 35 deletions(-)
diff mbox series

Patch

diff --git a/xen/common/sched/sched_credit.c b/xen/common/sched/sched_credit.c
index a098ca0f3a..8b1de9b033 100644
--- a/xen/common/sched/sched_credit.c
+++ b/xen/common/sched/sched_credit.c
@@ -1690,11 +1690,8 @@  csched_load_balance(struct csched_private *prv, int cpu,
 
     BUG_ON(get_sched_res(cpu) != snext->unit->res);
 
-    /*
-     * If this CPU is going offline, or is not (yet) part of any cpupool
-     * (as it happens, e.g., during cpu bringup), we shouldn't steal work.
-     */
-    if ( unlikely(!cpumask_test_cpu(cpu, online) || c == NULL) )
+    /* If this CPU is going offline, we shouldn't steal work.  */
+    if ( unlikely(!cpumask_test_cpu(cpu, online)) )
         goto out;
 
     if ( snext->pri == CSCHED_PRI_IDLE )
diff --git a/xen/common/sched/sched_credit2.c b/xen/common/sched/sched_credit2.c
index 5bfe1441a2..f9e521a3a8 100644
--- a/xen/common/sched/sched_credit2.c
+++ b/xen/common/sched/sched_credit2.c
@@ -2744,40 +2744,10 @@  static void
 csched2_unit_migrate(
     const struct scheduler *ops, struct sched_unit *unit, unsigned int new_cpu)
 {
-    struct domain *d = unit->domain;
     struct csched2_unit * const svc = csched2_unit(unit);
     struct csched2_runqueue_data *trqd;
     s_time_t now = NOW();
 
-    /*
-     * Being passed a target pCPU which is outside of our cpupool is only
-     * valid if we are shutting down (or doing ACPI suspend), and we are
-     * moving everyone to BSP, no matter whether or not BSP is inside our
-     * cpupool.
-     *
-     * And since there indeed is the chance that it is not part of it, all
-     * we must do is remove _and_ unassign the unit from any runqueue, as
-     * well as updating v->processor with the target, so that the suspend
-     * process can continue.
-     *
-     * It will then be during resume that a new, meaningful, value for
-     * v->processor will be chosen, and during actual domain unpause that
-     * the unit will be assigned to and added to the proper runqueue.
-     */
-    if ( unlikely(!cpumask_test_cpu(new_cpu, cpupool_domain_master_cpumask(d))) )
-    {
-        ASSERT(system_state == SYS_STATE_suspend);
-        if ( unit_on_runq(svc) )
-        {
-            runq_remove(svc);
-            update_load(ops, svc->rqd, NULL, -1, now);
-        }
-        _runq_deassign(svc);
-        sched_set_res(unit, get_sched_res(new_cpu));
-        return;
-    }
-
-    /* If here, new_cpu must be a valid Credit2 pCPU, and in our affinity. */
     ASSERT(cpumask_test_cpu(new_cpu, &csched2_priv(ops)->initialized));
     ASSERT(cpumask_test_cpu(new_cpu, unit->cpu_hard_affinity));