xen: credit2: respect credit2_runqueue=all when arranging runqueues
PATCH 1/1 xen: credit2: respect credit2_runqueue=all when arranging runqueues
Documentation for credit2_runqueue=all says it should create one queue for all pCPUs on the host. But since introduction sched_credit2_max_cpus_runqueue, it actually created separate runqueue per socket, even if the CPUs count is below sched_credit2_max_cpus_runqueue.
Adjust the condition to skip syblink check in case of credit2_runqueue=all.
---
The whole thing is under cpu_runqueue_match() already, so maybe cpu_runqueue_siblings_match() isn't needed at all?
[resent with fixed xen-devel address...]
--- xen/common/sched/credit2.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
xen/common/sched/credit2.c +5 -1
@@ -996,9 +996,13 @@ cpu_add_to_runqueue(const struct scheduler *ops, unsigned int cpu)* * Otherwise, let's try to make sure that siblings stay in the * same runqueue, pretty much under any cinrcumnstances. +* +* Furthermore, try to respect credit2_runqueue=all, as long as +* max_cpus_runq isn't violated. */ if ( rqd->refcnt < max_cpus_runq && (ops->cpupool->gran != SCHED_GRAN_cpu || -cpu_runqueue_siblings_match (rqd, cpu, max_cpus_runq)) ) +cpu_runqueue_siblings_match (rqd, cpu, max_cpus_runq) || + opt_runqueue ==OPT_RUNQUEUE_ALL ) ) {/* * This runqueue is ok, but as we said, we also want an even
Signature · 1 line
2.37.3
xen/common/sched/credit2.c cpu_add_to_runqueue(const struct scheduler *ops, unsigned int cpu) · line 1001
Quoted 9 lines · Marek Marczykowski-Górecki
xen/common/sched/credit2.c +3
-0@@ -996,9 +996,13 @@ cpu_add_to_runqueue(const struct scheduler *ops, unsigned int cpu)* * Otherwise, let's try to make sure that siblings stay in the * same runqueue, pretty much under any cinrcumnstances. +* +* Furthermore, try to respect credit2_runqueue=all, as long as +* max_cpus_runq isn't violated.
This last part is questionable, partly because the command line doc is ambiguous as to which of the two options is intended to "win". I guess one needs to know the original intentions to resolve this.
xen/common/sched/credit2.c cpu_add_to_runqueue(const struct scheduler *ops, unsigned int cpu) · line 1005
Quoted 5 lines
xen/common/sched/credit2.c +2
-1*/ if ( rqd->refcnt < max_cpus_runq && (ops->cpupool->gran != SCHED_GRAN_cpu || -cpu_runqueue_siblings_match (rqd, cpu, max_cpus_runq)) ) +cpu_runqueue_siblings_match (rqd, cpu, max_cpus_runq) || + opt_runqueue ==OPT_RUNQUEUE_ALL ) )
Indentation was already broken here. As you're touching it, may I ask that you correct that aspect?
Jan
Quoted 14 lines · Jan Beulich
xen/common/sched/credit2.c cpu_add_to_runqueue(const struct scheduler *ops, unsigned int cpu) · line 1001
Quoted 9 lines · Marek Marczykowski-Górecki
xen/common/sched/credit2.c +3
-0@@ -996,9 +996,13 @@ cpu_add_to_runqueue(const struct scheduler *ops, unsigned int cpu)* * Otherwise, let's try to make sure that siblings stay in the * same runqueue, pretty much under any cinrcumnstances. +* +* Furthermore, try to respect credit2_runqueue=all, as long as +* max_cpus_runq isn't violated. This last part is questionable, partly because the command line doc is ambiguous as to which of the two options is intended to "win". I guess one needs to know the original intentions to resolve this.
Right, I've chosen this approach, because you can still emulate the other by setting sufficiently large max_cpus_runq. I can add doc clarification in v2.
Signature · 3 lines
Best Regards, Marek Marczykowski-Górecki Invisible Things Lab
Juergen Gross
Reviewed-byQuoted 16 lines · Marek Marczykowski-Górecki
Quoted 14 lines · Jan Beulich
xen/common/sched/credit2.c cpu_add_to_runqueue(const struct scheduler *ops, unsigned int cpu) · line 1001
Quoted 9 lines · Marek Marczykowski-Górecki
xen/common/sched/credit2.c +3
-0@@ -996,9 +996,13 @@ cpu_add_to_runqueue(const struct scheduler *ops, unsigned int cpu)* * Otherwise, let's try to make sure that siblings stay in the * same runqueue, pretty much under any cinrcumnstances. +* +* Furthermore, try to respect credit2_runqueue=all, as long as +* max_cpus_runq isn't violated. This last part is questionable, partly because the command line doc is ambiguous as to which of the two options is intended to "win". I guess one needs to know the original intentions to resolve this.
Quoted 4 lines
Right, I've chosen this approach, because you can still emulate the other by setting sufficiently large
max_cpus_runq. I can add doc clarification in v2.
I think this is the better approach, as it allows more flexibility.
Updating the doc would be mandatory, though. With that added you can have my:
Juergen