xen/common/sched/credit.c | 2 +- xen/common/sched/credit2.c | 4 ++-- xen/common/sched/rt.c | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-)
Several files in xen/common/sched still reference schedule.c in
their comments, which was the original name of xen/common/sched/core.c
before commit 6cb4b01c03 ("xen/sched: move schedulers and cpupool
coding to dedicated directory") renamed and moved it.
Update the comments to reference core.c instead.
Signed-off-by: Furkan Caliskan <frn1furkan10@gmail.com>
---
xen/common/sched/credit.c | 2 +-
xen/common/sched/credit2.c | 4 ++--
xen/common/sched/rt.c | 12 ++++++------
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/xen/common/sched/credit.c b/xen/common/sched/credit.c
index 07656a57e9..fbcdc53f7b 100644
--- a/xen/common/sched/credit.c
+++ b/xen/common/sched/credit.c
@@ -873,7 +873,7 @@ csched_res_pick(const struct scheduler *ops, const struct sched_unit *unit)
struct csched_unit *svc = CSCHED_UNIT(unit);
/*
- * We have been called by vcpu_migrate() (in schedule.c), as part
+ * We have been called by vcpu_migrate() (in core.c), as part
* of the process of seeing if vc can be migrated to another pcpu.
* We make a note about this in svc->flags so that later, in
* csched_unit_wake() (still called from vcpu_migrate()) we won't
diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index 77475ee363..7eefcf480e 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -666,14 +666,14 @@ static inline bool has_cap(const struct csched2_unit *svc)
* runq, _always_ happens by means of tickling:
* - when an unit wakes up, it calls csched2_unit_wake(), which calls
* runq_tickle();
- * - when a migration is initiated in schedule.c, we call csched2_res_pick(),
+ * - when a migration is initiated in core.c, we call csched2_res_pick(),
* csched2_unit_migrate() (which calls migrate()) and csched2_unit_wake().
* csched2_res_pick() looks for the least loaded runq and return just any
* of its processors. Then, csched2_unit_migrate() just moves the unit to
* the chosen runq, and it is again runq_tickle(), called by
* csched2_unit_wake() that actually decides what pcpu to use within the
* chosen runq;
- * - when a migration is initiated in sched_credit2.c, by calling migrate()
+ * - when a migration is initiated in credit2.c, by calling migrate()
* directly, that again temporarily use a random pcpu from the new runq,
* and then calls runq_tickle(), by itself.
*/
diff --git a/xen/common/sched/rt.c b/xen/common/sched/rt.c
index 4b637aa9db..8aa6ee31eb 100644
--- a/xen/common/sched/rt.c
+++ b/xen/common/sched/rt.c
@@ -80,7 +80,7 @@
* from all physical cpus.
*
* The lock is already grabbed when calling wake/sleep/schedule/ functions
- * in schedule.c
+ * in core.c
*
* The functions involes RunQ and needs to grab locks are:
* unit_insert, unit_remove, context_saved, runq_insert
@@ -894,8 +894,8 @@ rt_free_udata(const struct scheduler *ops, void *priv)
}
/*
- * It is called in sched_move_domain() and sched_init_vcpu
- * in schedule.c.
+ * It is called in sched_move_domain() and sched_init_vcpu()
+ * in core.c.
* When move a domain to a new cpupool.
* It inserts units of moving domain to the scheduler's RunQ in
* dest. cpupool.
@@ -1074,7 +1074,7 @@ runq_pick(const struct scheduler *ops, const cpumask_t *mask, unsigned int cpu)
/*
* schedule function for rt scheduler.
- * The lock is already grabbed in schedule.c, no need to lock here
+ * The lock is already grabbed in core.c, no need to lock here
*/
static void cf_check
rt_schedule(const struct scheduler *ops, struct sched_unit *currunit,
@@ -1168,7 +1168,7 @@ rt_schedule(const struct scheduler *ops, struct sched_unit *currunit,
/*
* Remove UNIT from RunQ
- * The lock is already grabbed in schedule.c, no need to lock here
+ * The lock is already grabbed in core.c, no need to lock here
*/
static void cf_check
rt_unit_sleep(const struct scheduler *ops, struct sched_unit *unit)
@@ -1281,7 +1281,7 @@ runq_tickle(const struct scheduler *ops, const struct rt_unit *new)
/*
* Should always wake up runnable unit, put it back to RunQ.
* Check priority to raise interrupt
- * The lock is already grabbed in schedule.c, no need to lock here
+ * The lock is already grabbed in core.c, no need to lock here
* TODO: what if these two units belongs to the same domain?
*/
static void cf_check
--
2.34.1
On 01/06/2026 6:30 am, Furkan Caliskan wrote: > diff --git a/xen/common/sched/credit.c b/xen/common/sched/credit.c > index 07656a57e9..fbcdc53f7b 100644 > --- a/xen/common/sched/credit.c > +++ b/xen/common/sched/credit.c > @@ -873,7 +873,7 @@ csched_res_pick(const struct scheduler *ops, const struct sched_unit *unit) > struct csched_unit *svc = CSCHED_UNIT(unit); > > /* > - * We have been called by vcpu_migrate() (in schedule.c), as part > + * We have been called by vcpu_migrate() (in core.c), as part As you've found, file references get stale, but so do function references. vcpu_migrate() ceased existing in 9a36de177c1 "xen/schedule: Fix races in vcpu migration" in 2018. These comments want adjusting rather more. In this case: diff --git a/xen/common/sched/credit.c b/xen/common/sched/credit.c index 07656a57e979..5ee26cde58f6 100644 --- a/xen/common/sched/credit.c +++ b/xen/common/sched/credit.c @@ -873,11 +873,12 @@ csched_res_pick(const struct scheduler *ops, const struct sched_unit *unit) struct csched_unit *svc = CSCHED_UNIT(unit); /* - * We have been called by vcpu_migrate() (in schedule.c), as part - * of the process of seeing if vc can be migrated to another pcpu. + * We have been called, as part of the process of seeing if vc can be + * migrated to another pcpu. + * * We make a note about this in svc->flags so that later, in - * csched_unit_wake() (still called from vcpu_migrate()) we won't - * get boosted, which we don't deserve as we are "only" migrating. + * csched_unit_wake() we won't get boosted, which we don't deserve as we + * are "only" migrating. */ set_bit(CSCHED_FLAG_UNIT_MIGRATING, &svc->flags); return get_sched_res(_csched_cpu_pick(ops, unit, true)); still has all the salient information but is rather less likely to get stale. ~Andrew
On 6/1/26 14:12, Andrew Cooper wrote: > On 01/06/2026 6:30 am, Furkan Caliskan wrote: >> diff --git a/xen/common/sched/credit.c b/xen/common/sched/credit.c >> index 07656a57e9..fbcdc53f7b 100644 >> --- a/xen/common/sched/credit.c >> +++ b/xen/common/sched/credit.c >> @@ -873,7 +873,7 @@ csched_res_pick(const struct scheduler *ops, const struct sched_unit *unit) >> struct csched_unit *svc = CSCHED_UNIT(unit); >> >> /* >> - * We have been called by vcpu_migrate() (in schedule.c), as part >> + * We have been called by vcpu_migrate() (in core.c), as part > > As you've found, file references get stale, but so do function > references. vcpu_migrate() ceased existing in 9a36de177c1 > "xen/schedule: Fix races in vcpu migration" in 2018. > > These comments want adjusting rather more. In this case: > > diff --git a/xen/common/sched/credit.c b/xen/common/sched/credit.c > index 07656a57e979..5ee26cde58f6 100644 > --- a/xen/common/sched/credit.c > +++ b/xen/common/sched/credit.c > @@ -873,11 +873,12 @@ csched_res_pick(const struct scheduler *ops, const > struct sched_unit *unit) > struct csched_unit *svc = CSCHED_UNIT(unit); > > /* > - * We have been called by vcpu_migrate() (in schedule.c), as part > - * of the process of seeing if vc can be migrated to another pcpu. > + * We have been called, as part of the process of seeing if vc can be > + * migrated to another pcpu. > + * > * We make a note about this in svc->flags so that later, in > - * csched_unit_wake() (still called from vcpu_migrate()) we won't > - * get boosted, which we don't deserve as we are "only" migrating. > + * csched_unit_wake() we won't get boosted, which we don't deserve > as we > + * are "only" migrating. > */ > set_bit(CSCHED_FLAG_UNIT_MIGRATING, &svc->flags); > return get_sched_res(_csched_cpu_pick(ops, unit, true)); > > > still has all the salient information but is rather less likely to get > stale. > > ~Andrew Thanks for the feedback Andrew. I only checked for stale file references and missed the stale function references. I will fix it, and send a v2.
Several files in xen/common/sched still reference schedule.c in
their comments, which was the original name of xen/common/sched/core.c
before commit 6cb4b01c03 ("xen/sched: move schedulers and cpupool
coding to dedicated directory") renamed and moved it. Some comments
also reference functions that no longer exist.
Rework the comments to remove stale file and function references.
Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Furkan Caliskan <frn1furkan10@gmail.com>
---
xen/common/sched/credit.c | 9 +++++----
xen/common/sched/credit2.c | 6 +++---
xen/common/sched/rt.c | 10 ++++------
3 files changed, 12 insertions(+), 13 deletions(-)
diff --git a/xen/common/sched/credit.c b/xen/common/sched/credit.c
index 07656a57e9..328c802d0c 100644
--- a/xen/common/sched/credit.c
+++ b/xen/common/sched/credit.c
@@ -873,11 +873,12 @@ csched_res_pick(const struct scheduler *ops, const struct sched_unit *unit)
struct csched_unit *svc = CSCHED_UNIT(unit);
/*
- * We have been called by vcpu_migrate() (in schedule.c), as part
- * of the process of seeing if vc can be migrated to another pcpu.
+ * We have been called, as part of the process of seeing if vc can be
+ * migrated to another pcpu.
+ *
* We make a note about this in svc->flags so that later, in
- * csched_unit_wake() (still called from vcpu_migrate()) we won't
- * get boosted, which we don't deserve as we are "only" migrating.
+ * csched_unit_wake() we won't get boosted, which we don't deserve
+ * as we are "only" migrating.
*/
set_bit(CSCHED_FLAG_UNIT_MIGRATING, &svc->flags);
return get_sched_res(_csched_cpu_pick(ops, unit, true));
diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c
index 77475ee363..95946634d1 100644
--- a/xen/common/sched/credit2.c
+++ b/xen/common/sched/credit2.c
@@ -666,15 +666,15 @@ static inline bool has_cap(const struct csched2_unit *svc)
* runq, _always_ happens by means of tickling:
* - when an unit wakes up, it calls csched2_unit_wake(), which calls
* runq_tickle();
- * - when a migration is initiated in schedule.c, we call csched2_res_pick(),
+ * - when a migration is initiated, we call csched2_res_pick(),
* csched2_unit_migrate() (which calls migrate()) and csched2_unit_wake().
* csched2_res_pick() looks for the least loaded runq and return just any
* of its processors. Then, csched2_unit_migrate() just moves the unit to
* the chosen runq, and it is again runq_tickle(), called by
* csched2_unit_wake() that actually decides what pcpu to use within the
* chosen runq;
- * - when a migration is initiated in sched_credit2.c, by calling migrate()
- * directly, that again temporarily use a random pcpu from the new runq,
+ * - when a migration is initiated, by calling migrate() directly,
+ * that again temporarily use a random pcpu from the new runq,
* and then calls runq_tickle(), by itself.
*/
diff --git a/xen/common/sched/rt.c b/xen/common/sched/rt.c
index 4b637aa9db..e2a5d43679 100644
--- a/xen/common/sched/rt.c
+++ b/xen/common/sched/rt.c
@@ -80,7 +80,6 @@
* from all physical cpus.
*
* The lock is already grabbed when calling wake/sleep/schedule/ functions
- * in schedule.c
*
* The functions involes RunQ and needs to grab locks are:
* unit_insert, unit_remove, context_saved, runq_insert
@@ -894,8 +893,7 @@ rt_free_udata(const struct scheduler *ops, void *priv)
}
/*
- * It is called in sched_move_domain() and sched_init_vcpu
- * in schedule.c.
+ * It is called in sched_move_domain() and sched_init_vcpu()
* When move a domain to a new cpupool.
* It inserts units of moving domain to the scheduler's RunQ in
* dest. cpupool.
@@ -1074,7 +1072,7 @@ runq_pick(const struct scheduler *ops, const cpumask_t *mask, unsigned int cpu)
/*
* schedule function for rt scheduler.
- * The lock is already grabbed in schedule.c, no need to lock here
+ * The lock is already grabbed by the caller, no need to lock here
*/
static void cf_check
rt_schedule(const struct scheduler *ops, struct sched_unit *currunit,
@@ -1168,7 +1166,7 @@ rt_schedule(const struct scheduler *ops, struct sched_unit *currunit,
/*
* Remove UNIT from RunQ
- * The lock is already grabbed in schedule.c, no need to lock here
+ * The lock is already grabbed by the caller, no need to lock here
*/
static void cf_check
rt_unit_sleep(const struct scheduler *ops, struct sched_unit *unit)
@@ -1281,7 +1279,7 @@ runq_tickle(const struct scheduler *ops, const struct rt_unit *new)
/*
* Should always wake up runnable unit, put it back to RunQ.
* Check priority to raise interrupt
- * The lock is already grabbed in schedule.c, no need to lock here
+ * The lock is already grabbed by the caller, no need to lock here
* TODO: what if these two units belongs to the same domain?
*/
static void cf_check
--
2.34.1
© 2016 - 2026 Red Hat, Inc.