All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen/sched: try harder to find a runnable unit in rt_schedule()
@ 2022-10-21 10:39 Juergen Gross
  2022-11-04  7:51 ` Dario Faggioli
  0 siblings, 1 reply; 2+ messages in thread
From: Juergen Gross @ 2022-10-21 10:39 UTC (permalink / raw)
  To: xen-devel; +Cc: Juergen Gross, Dario Faggioli, Meng Xu, George Dunlap

Instead of directly falling back to the idle unit in case the top
unit from the run queue happened to be not runnable, consult the run
queue again.

Suggested-by: Dario Faggioli <dfaggioli@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 xen/common/sched/rt.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/xen/common/sched/rt.c b/xen/common/sched/rt.c
index 960a8033e2..1f8d074884 100644
--- a/xen/common/sched/rt.c
+++ b/xen/common/sched/rt.c
@@ -1080,15 +1080,20 @@ rt_schedule(const struct scheduler *ops, struct sched_unit *currunit,
     }
     else
     {
-        snext = runq_pick(ops, cpumask_of(sched_cpu), cur_cpu);
-
-        if ( snext == NULL )
-            snext = rt_unit(sched_idle_unit(sched_cpu));
-        else if ( !unit_runnable_state(snext->unit) )
+        while ( true )
         {
+            snext = runq_pick(ops, cpumask_of(sched_cpu), cur_cpu);
+
+            if ( snext == NULL )
+            {
+                snext = rt_unit(sched_idle_unit(sched_cpu));
+                break;
+            }
+            if ( unit_runnable_state(snext->unit) )
+                break;
+
             q_remove(snext);
             replq_remove(ops, snext);
-            snext = rt_unit(sched_idle_unit(sched_cpu));
         }
 
         /* if scurr has higher priority and budget, still pick scurr */
-- 
2.35.3



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] xen/sched: try harder to find a runnable unit in rt_schedule()
  2022-10-21 10:39 [PATCH] xen/sched: try harder to find a runnable unit in rt_schedule() Juergen Gross
@ 2022-11-04  7:51 ` Dario Faggioli
  0 siblings, 0 replies; 2+ messages in thread
From: Dario Faggioli @ 2022-11-04  7:51 UTC (permalink / raw)
  To: Juergen Gross, xen-devel; +Cc: george.dunlap, mengxu

[-- Attachment #1: Type: text/plain, Size: 695 bytes --]

On Fri, 2022-10-21 at 12:39 +0200, Juergen Gross wrote:
> Instead of directly falling back to the idle unit in case the top
> unit from the run queue happened to be not runnable, consult the run
> queue again.
> 
> Suggested-by: Dario Faggioli <dfaggioli@suse.com>
> Signed-off-by: Juergen Gross <jgross@suse.com>
>
Reviewed-by: Dario Faggioli <dfaggioli@suse.com>

And thanks for making the patch! :-)

Regards
-- 
Dario Faggioli, Ph.D
http://about.me/dario.faggioli
Virtualization Software Engineer
SUSE Labs, SUSE https://www.suse.com/
-------------------------------------------------------------------
<<This happens because _I_ choose it to happen!>> (Raistlin Majere)

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-04  7:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-21 10:39 [PATCH] xen/sched: try harder to find a runnable unit in rt_schedule() Juergen Gross
2022-11-04  7:51 ` Dario Faggioli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.