From bb6860b5598ab5c40b31f31bf79cad9274589ab4 Mon Sep 17 00:00:00 2001 From: Nuno Antunes Date: Thu, 13 Sep 2012 08:07:08 +0100 Subject: [PATCH] Expand a comment in lwkt_switch(). --- sys/kern/lwkt_thread.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/kern/lwkt_thread.c b/sys/kern/lwkt_thread.c index bf6e0e7071..10d168e35c 100644 --- a/sys/kern/lwkt_thread.c +++ b/sys/kern/lwkt_thread.c @@ -774,7 +774,9 @@ lwkt_switch(void) /* * Never schedule threads returning to userland or the * user thread scheduler helper thread when higher priority - * threads are present. + * threads are present. The runq is sorted by priority + * so we can give up traversing it when we find the first + * low priority thread. */ if (ntd->td_pri < TDPRI_KERN_LPSCHED) { ntd = NULL; -- 2.41.0