2 * Copyright (c) 2009 Apple Inc. All rights reserved.
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
29 #include <mach/mach_types.h>
30 #include <mach/machine.h>
31 #include <mach/policy.h>
32 #include <mach/sync_policy.h>
33 #include <mach/thread_act.h>
35 #include <machine/machine_routines.h>
36 #include <machine/sched_param.h>
37 #include <machine/machine_cpu.h>
39 #include <kern/kern_types.h>
40 #include <kern/clock.h>
41 #include <kern/counters.h>
42 #include <kern/cpu_number.h>
43 #include <kern/cpu_data.h>
44 #include <kern/debug.h>
45 #include <kern/macro_help.h>
46 #include <kern/machine.h>
47 #include <kern/misc_protos.h>
48 #include <kern/processor.h>
49 #include <kern/queue.h>
50 #include <kern/sched.h>
51 #include <kern/sched_prim.h>
52 #include <kern/syscall_subr.h>
53 #include <kern/task.h>
54 #include <kern/thread.h>
55 #include <kern/wait_queue.h>
58 #include <vm/vm_kern.h>
59 #include <vm/vm_map.h>
63 #include <sys/kdebug.h>
65 #if defined(CONFIG_SCHED_GRRR_CORE)
68 grrr_priority_mapping_init(void);
86 grrr_sorted_list_insert_group(grrr_run_queue_t rq
,
90 grrr_rescale_work(grrr_run_queue_t rq
);
93 grrr_runqueue_init(grrr_run_queue_t runq
);
95 /* Map Mach priorities to ones suitable for proportional sharing */
96 static grrr_proportional_priority_t grrr_priority_mapping
[NRQS
];
98 /* Map each proportional priority to its group */
99 static grrr_group_index_t grrr_group_mapping
[NUM_GRRR_PROPORTIONAL_PRIORITIES
];
101 uint32_t grrr_rescale_tick
;
103 #endif /* defined(CONFIG_SCHED_GRRR_CORE) */
105 #if defined(CONFIG_SCHED_GRRR)
108 sched_grrr_init(void);
111 sched_grrr_timebase_init(void);
114 sched_grrr_processor_init(processor_t processor
);
117 sched_grrr_pset_init(processor_set_t pset
);
120 sched_grrr_maintenance_continuation(void);
123 sched_grrr_choose_thread(processor_t processor
,
128 sched_grrr_steal_thread(processor_set_t pset
);
131 sched_grrr_compute_priority(thread_t thread
,
132 boolean_t override_depress
);
135 sched_grrr_choose_processor( processor_set_t pset
,
136 processor_t processor
,
140 sched_grrr_processor_enqueue(
141 processor_t processor
,
146 sched_grrr_processor_queue_shutdown(
147 processor_t processor
);
150 sched_grrr_processor_queue_remove(
151 processor_t processor
,
155 sched_grrr_processor_queue_empty(processor_t processor
);
158 sched_grrr_processor_queue_has_priority(processor_t processor
,
163 sched_grrr_priority_is_urgent(int priority
);
166 sched_grrr_processor_csw_check(processor_t processor
);
169 sched_grrr_initial_quantum_size(thread_t thread
);
172 sched_grrr_initial_thread_sched_mode(task_t parent_task
);
175 sched_grrr_can_update_priority(thread_t thread
);
178 sched_grrr_update_priority(thread_t thread
);
181 sched_grrr_lightweight_update_priority(thread_t thread
);
184 sched_grrr_quantum_expire(thread_t thread
);
187 sched_grrr_should_current_thread_rechoose_processor(processor_t processor
);
190 sched_grrr_processor_runq_count(processor_t processor
);
193 sched_grrr_processor_runq_stats_count_sum(processor_t processor
);
196 sched_grrr_processor_bound_count(processor_t processor
);
199 sched_grrr_thread_update_scan(void);
201 const struct sched_dispatch_table sched_grrr_dispatch
= {
202 .init
= sched_grrr_init
,
203 .timebase_init
= sched_grrr_timebase_init
,
204 .processor_init
= sched_grrr_processor_init
,
205 .pset_init
= sched_grrr_pset_init
,
206 .maintenance_continuation
= sched_grrr_maintenance_continuation
,
207 .choose_thread
= sched_grrr_choose_thread
,
208 .steal_thread
= sched_grrr_steal_thread
,
209 .compute_priority
= sched_grrr_compute_priority
,
210 .choose_processor
= sched_grrr_choose_processor
,
211 .processor_enqueue
= sched_grrr_processor_enqueue
,
212 .processor_queue_shutdown
= sched_grrr_processor_queue_shutdown
,
213 .processor_queue_remove
= sched_grrr_processor_queue_remove
,
214 .processor_queue_empty
= sched_grrr_processor_queue_empty
,
215 .priority_is_urgent
= sched_grrr_priority_is_urgent
,
216 .processor_csw_check
= sched_grrr_processor_csw_check
,
217 .processor_queue_has_priority
= sched_grrr_processor_queue_has_priority
,
218 .initial_quantum_size
= sched_grrr_initial_quantum_size
,
219 .initial_thread_sched_mode
= sched_grrr_initial_thread_sched_mode
,
220 .can_update_priority
= sched_grrr_can_update_priority
,
221 .update_priority
= sched_grrr_update_priority
,
222 .lightweight_update_priority
= sched_grrr_lightweight_update_priority
,
223 .quantum_expire
= sched_grrr_quantum_expire
,
224 .should_current_thread_rechoose_processor
= sched_grrr_should_current_thread_rechoose_processor
,
225 .processor_runq_count
= sched_grrr_processor_runq_count
,
226 .processor_runq_stats_count_sum
= sched_grrr_processor_runq_stats_count_sum
,
227 .fairshare_init
= sched_grrr_fairshare_init
,
228 .fairshare_runq_count
= sched_grrr_fairshare_runq_count
,
229 .fairshare_runq_stats_count_sum
= sched_grrr_fairshare_runq_stats_count_sum
,
230 .fairshare_enqueue
= sched_grrr_fairshare_enqueue
,
231 .fairshare_dequeue
= sched_grrr_fairshare_dequeue
,
232 .fairshare_queue_remove
= sched_grrr_fairshare_queue_remove
,
233 .processor_bound_count
= sched_grrr_processor_bound_count
,
234 .thread_update_scan
= sched_grrr_thread_update_scan
,
235 .direct_dispatch_to_idle_processors
= TRUE
,
238 extern int max_unsafe_quanta
;
240 static uint32_t grrr_quantum_us
;
241 static uint32_t grrr_quantum
;
243 static uint64_t sched_grrr_tick_deadline
;
246 sched_grrr_init(void)
248 if (default_preemption_rate
< 1)
249 default_preemption_rate
= 100;
250 grrr_quantum_us
= (1000 * 1000) / default_preemption_rate
;
252 printf("standard grrr timeslicing quantum is %d us\n", grrr_quantum_us
);
254 grrr_priority_mapping_init();
258 sched_grrr_timebase_init(void)
262 /* standard timeslicing quantum */
263 clock_interval_to_absolutetime_interval(
264 grrr_quantum_us
, NSEC_PER_USEC
, &abstime
);
265 assert((abstime
>> 32) == 0 && (uint32_t)abstime
!= 0);
266 grrr_quantum
= (uint32_t)abstime
;
268 thread_depress_time
= 1 * grrr_quantum
;
269 default_timeshare_computation
= grrr_quantum
/ 2;
270 default_timeshare_constraint
= grrr_quantum
;
272 max_unsafe_computation
= max_unsafe_quanta
* grrr_quantum
;
273 sched_safe_duration
= 2 * max_unsafe_quanta
* grrr_quantum
;
278 sched_grrr_processor_init(processor_t processor
)
280 grrr_runqueue_init(&processor
->grrr_runq
);
284 sched_grrr_pset_init(processor_set_t pset __unused
)
289 sched_grrr_maintenance_continuation(void)
291 uint64_t abstime
= mach_absolute_time();
296 * Compute various averages.
300 if (sched_grrr_tick_deadline
== 0)
301 sched_grrr_tick_deadline
= abstime
;
303 clock_deadline_for_periodic_event(10*sched_one_second_interval
, abstime
,
304 &sched_grrr_tick_deadline
);
306 assert_wait_deadline((event_t
)sched_grrr_maintenance_continuation
, THREAD_UNINT
, sched_grrr_tick_deadline
);
307 thread_block((thread_continue_t
)sched_grrr_maintenance_continuation
);
313 sched_grrr_choose_thread(processor_t processor
,
314 int priority __unused
,
315 ast_t reason __unused
)
317 grrr_run_queue_t rq
= &processor
->grrr_runq
;
319 return grrr_select(rq
);
323 sched_grrr_steal_thread(processor_set_t pset
)
327 return (THREAD_NULL
);
332 sched_grrr_compute_priority(thread_t thread
,
333 boolean_t override_depress __unused
)
335 set_sched_pri(thread
, thread
->priority
);
339 sched_grrr_choose_processor( processor_set_t pset
,
340 processor_t processor
,
343 return choose_processor(pset
, processor
, thread
);
347 sched_grrr_processor_enqueue(
348 processor_t processor
,
350 integer_t options __unused
)
352 grrr_run_queue_t rq
= &processor
->grrr_runq
;
355 result
= grrr_enqueue(rq
, thread
);
357 thread
->runq
= processor
;
363 sched_grrr_processor_queue_shutdown(
364 processor_t processor
)
366 processor_set_t pset
= processor
->processor_set
;
368 queue_head_t tqueue
, bqueue
;
373 while ((thread
= sched_grrr_choose_thread(processor
, IDLEPRI
, AST_NONE
)) != THREAD_NULL
) {
374 if (thread
->bound_processor
== PROCESSOR_NULL
) {
375 enqueue_tail(&tqueue
, (queue_entry_t
)thread
);
377 enqueue_tail(&bqueue
, (queue_entry_t
)thread
);
381 while ((thread
= (thread_t
)(void *)dequeue_head(&bqueue
)) != THREAD_NULL
) {
382 sched_grrr_processor_enqueue(processor
, thread
, SCHED_TAILQ
);
387 while ((thread
= (thread_t
)(void *)dequeue_head(&tqueue
)) != THREAD_NULL
) {
390 thread_setrun(thread
, SCHED_TAILQ
);
392 thread_unlock(thread
);
397 sched_grrr_processor_queue_remove(
398 processor_t processor
,
403 rqlock
= &processor
->processor_set
->sched_lock
;
406 if (processor
== thread
->runq
) {
408 * Thread is on a run queue and we have a lock on
411 grrr_run_queue_t rq
= &processor
->grrr_runq
;
413 grrr_remove(rq
, thread
);
416 * The thread left the run queue before we could
417 * lock the run queue.
419 assert(thread
->runq
== PROCESSOR_NULL
);
420 processor
= PROCESSOR_NULL
;
423 simple_unlock(rqlock
);
425 return (processor
!= PROCESSOR_NULL
);
429 sched_grrr_processor_queue_empty(processor_t processor __unused
)
433 result
= (processor
->grrr_runq
.count
== 0);
439 sched_grrr_processor_queue_has_priority(processor_t processor
,
441 boolean_t gte __unused
)
443 grrr_run_queue_t rq
= &processor
->grrr_runq
;
446 i
= grrr_group_mapping
[grrr_priority_mapping
[priority
]];
447 for ( ; i
< NUM_GRRR_GROUPS
; i
++) {
448 if (rq
->groups
[i
].count
> 0)
455 /* Implement sched_preempt_pri in code */
457 sched_grrr_priority_is_urgent(int priority
)
459 if (priority
<= BASEPRI_FOREGROUND
)
462 if (priority
< MINPRI_KERNEL
)
465 if (priority
>= BASEPRI_PREEMPT
)
472 sched_grrr_processor_csw_check(processor_t processor
)
476 count
= sched_grrr_processor_runq_count(processor
);
487 sched_grrr_initial_quantum_size(thread_t thread __unused
)
493 sched_grrr_initial_thread_sched_mode(task_t parent_task
)
495 if (parent_task
== kernel_task
)
496 return TH_MODE_FIXED
;
498 return TH_MODE_TIMESHARE
;
502 sched_grrr_can_update_priority(thread_t thread __unused
)
508 sched_grrr_update_priority(thread_t thread __unused
)
514 sched_grrr_lightweight_update_priority(thread_t thread __unused
)
520 sched_grrr_quantum_expire(
521 thread_t thread __unused
)
527 sched_grrr_should_current_thread_rechoose_processor(processor_t processor __unused
)
533 sched_grrr_processor_runq_count(processor_t processor
)
535 return processor
->grrr_runq
.count
;
539 sched_grrr_processor_runq_stats_count_sum(processor_t processor
)
541 return processor
->grrr_runq
.runq_stats
.count_sum
;
545 sched_grrr_processor_bound_count(__unused processor_t processor
)
551 sched_grrr_thread_update_scan(void)
556 #endif /* defined(CONFIG_SCHED_GRRR) */
558 #if defined(CONFIG_SCHED_GRRR_CORE)
561 grrr_priority_mapping_init(void)
565 /* Map 0->0 up to 10->20 */
566 for (i
=0; i
<= 10; i
++) {
567 grrr_priority_mapping
[i
] = 2*i
;
570 /* Map user priorities 11->33 up to 51 -> 153 */
571 for (i
=11; i
<= 51; i
++) {
572 grrr_priority_mapping
[i
] = 3*i
;
575 /* Map high priorities 52->180 up to 127->255 */
576 for (i
=52; i
<= 127; i
++) {
577 grrr_priority_mapping
[i
] = 128 + i
;
580 for (i
= 0; i
< NUM_GRRR_PROPORTIONAL_PRIORITIES
; i
++) {
584 /* Calculate log(i); */
585 for (j
=0, k
=1; k
<= i
; j
++, k
*= 2);
589 grrr_group_mapping
[i
] = i
>> 2;
595 grrr_intragroup_schedule(grrr_group_t group
)
599 if (group
->count
== 0) {
603 thread
= group
->current_client
;
604 if (thread
== THREAD_NULL
) {
605 thread
= (thread_t
)(void *)queue_first(&group
->clients
);
608 if (1 /* deficit */) {
609 group
->current_client
= (thread_t
)(void *)queue_next((queue_entry_t
)thread
);
610 if (queue_end(&group
->clients
, (queue_entry_t
)group
->current_client
)) {
611 group
->current_client
= (thread_t
)(void *)queue_first(&group
->clients
);
614 thread
= group
->current_client
;
621 grrr_intergroup_schedule(grrr_run_queue_t rq
)
626 if (rq
->count
== 0) {
630 group
= rq
->current_group
;
632 if (group
== GRRR_GROUP_NULL
) {
633 group
= (grrr_group_t
)queue_first(&rq
->sorted_group_list
);
636 thread
= grrr_intragroup_schedule(group
);
638 if ((group
->work
>= (UINT32_MAX
-256)) || (rq
->last_rescale_tick
!= grrr_rescale_tick
)) {
639 grrr_rescale_work(rq
);
643 if (queue_end(&rq
->sorted_group_list
, queue_next((queue_entry_t
)group
))) {
644 /* last group, go back to beginning */
645 group
= (grrr_group_t
)queue_first(&rq
->sorted_group_list
);
647 grrr_group_t nextgroup
= (grrr_group_t
)queue_next((queue_entry_t
)group
);
648 uint64_t orderleft
, orderright
;
651 * The well-ordering condition for intergroup selection is:
653 * (group->work+1) / (nextgroup->work+1) > (group->weight) / (nextgroup->weight)
655 * Multiply both sides by their denominators to avoid division
658 orderleft
= (group
->work
+ 1) * ((uint64_t)nextgroup
->weight
);
659 orderright
= (nextgroup
->work
+ 1) * ((uint64_t)group
->weight
);
660 if (orderleft
> orderright
) {
663 group
= (grrr_group_t
)queue_first(&rq
->sorted_group_list
);
667 rq
->current_group
= group
;
673 grrr_runqueue_init(grrr_run_queue_t runq
)
675 grrr_group_index_t index
;
679 for (index
= 0; index
< NUM_GRRR_GROUPS
; index
++) {
680 unsigned int prisearch
;
683 prisearch
< NUM_GRRR_PROPORTIONAL_PRIORITIES
;
685 if (grrr_group_mapping
[prisearch
] == index
) {
686 runq
->groups
[index
].minpriority
= (grrr_proportional_priority_t
)prisearch
;
691 runq
->groups
[index
].index
= index
;
693 queue_init(&runq
->groups
[index
].clients
);
694 runq
->groups
[index
].count
= 0;
695 runq
->groups
[index
].weight
= 0;
696 runq
->groups
[index
].work
= 0;
697 runq
->groups
[index
].current_client
= THREAD_NULL
;
700 queue_init(&runq
->sorted_group_list
);
702 runq
->current_group
= GRRR_GROUP_NULL
;
706 grrr_rescale_work(grrr_run_queue_t rq
)
708 grrr_group_index_t index
;
710 /* avoid overflow by scaling by 1/8th */
711 for (index
= 0; index
< NUM_GRRR_GROUPS
; index
++) {
712 rq
->groups
[index
].work
>>= 3;
715 rq
->last_rescale_tick
= grrr_rescale_tick
;
723 grrr_proportional_priority_t gpriority
;
724 grrr_group_index_t gindex
;
727 gpriority
= grrr_priority_mapping
[thread
->sched_pri
];
728 gindex
= grrr_group_mapping
[gpriority
];
729 group
= &rq
->groups
[gindex
];
732 thread
->grrr_deficit
= 0;
735 if (group
->count
== 0) {
736 /* Empty group, this is the first client */
737 enqueue_tail(&group
->clients
, (queue_entry_t
)thread
);
739 group
->weight
= gpriority
;
740 group
->current_client
= thread
;
742 /* Insert before the current client */
743 if (group
->current_client
== THREAD_NULL
||
744 queue_first(&group
->clients
) == (queue_entry_t
)group
->current_client
) {
745 enqueue_head(&group
->clients
, (queue_entry_t
)thread
);
747 insque((queue_entry_t
)thread
, queue_prev((queue_entry_t
)group
->current_client
));
749 SCHED_STATS_RUNQ_CHANGE(&rq
->runq_stats
, rq
->count
);
751 group
->weight
+= gpriority
;
753 /* Since there was already a client, this is on the per-processor sorted list already */
754 remqueue((queue_entry_t
)group
);
757 grrr_sorted_list_insert_group(rq
, group
);
760 rq
->weight
+= gpriority
;
766 grrr_select(grrr_run_queue_t rq
)
770 thread
= grrr_intergroup_schedule(rq
);
771 if (thread
!= THREAD_NULL
) {
772 grrr_proportional_priority_t gpriority
;
773 grrr_group_index_t gindex
;
776 gpriority
= grrr_priority_mapping
[thread
->sched_pri
];
777 gindex
= grrr_group_mapping
[gpriority
];
778 group
= &rq
->groups
[gindex
];
780 remqueue((queue_entry_t
)thread
);
781 SCHED_STATS_RUNQ_CHANGE(&rq
->runq_stats
, rq
->count
);
783 group
->weight
-= gpriority
;
784 if (group
->current_client
== thread
) {
785 group
->current_client
= THREAD_NULL
;
788 remqueue((queue_entry_t
)group
);
789 if (group
->count
== 0) {
790 if (rq
->current_group
== group
) {
791 rq
->current_group
= GRRR_GROUP_NULL
;
794 /* Need to re-insert in sorted location */
795 grrr_sorted_list_insert_group(rq
, group
);
799 rq
->weight
-= gpriority
;
801 thread
->runq
= PROCESSOR_NULL
;
813 grrr_proportional_priority_t gpriority
;
814 grrr_group_index_t gindex
;
817 gpriority
= grrr_priority_mapping
[thread
->sched_pri
];
818 gindex
= grrr_group_mapping
[gpriority
];
819 group
= &rq
->groups
[gindex
];
821 remqueue((queue_entry_t
)thread
);
822 SCHED_STATS_RUNQ_CHANGE(&rq
->runq_stats
, rq
->count
);
824 group
->weight
-= gpriority
;
825 if (group
->current_client
== thread
) {
826 group
->current_client
= THREAD_NULL
;
829 remqueue((queue_entry_t
)group
);
830 if (group
->count
== 0) {
831 if (rq
->current_group
== group
) {
832 rq
->current_group
= GRRR_GROUP_NULL
;
835 /* Need to re-insert in sorted location */
836 grrr_sorted_list_insert_group(rq
, group
);
840 rq
->weight
-= gpriority
;
842 thread
->runq
= PROCESSOR_NULL
;
846 grrr_sorted_list_insert_group(grrr_run_queue_t rq
,
849 /* Simple insertion sort */
850 if (queue_empty(&rq
->sorted_group_list
)) {
851 enqueue_tail(&rq
->sorted_group_list
, (queue_entry_t
)group
);
853 grrr_group_t search_group
;
855 /* Start searching from the head (heaviest weight) for the first
856 * element less than us, so we can insert before it
858 search_group
= (grrr_group_t
)queue_first(&rq
->sorted_group_list
);
859 while (!queue_end(&rq
->sorted_group_list
, (queue_entry_t
)search_group
) ) {
861 if (search_group
->weight
< group
->weight
) {
862 /* we should be before this */
863 search_group
= (grrr_group_t
)queue_prev((queue_entry_t
)search_group
);
865 } if (search_group
->weight
== group
->weight
) {
866 /* Use group index as a tie breaker */
867 if (search_group
->index
< group
->index
) {
868 search_group
= (grrr_group_t
)queue_prev((queue_entry_t
)search_group
);
873 /* otherwise, our weight is too small, keep going */
874 search_group
= (grrr_group_t
)queue_next((queue_entry_t
)search_group
);
877 if (queue_end(&rq
->sorted_group_list
, (queue_entry_t
)search_group
)) {
878 enqueue_tail(&rq
->sorted_group_list
, (queue_entry_t
)group
);
880 insque((queue_entry_t
)group
, (queue_entry_t
)search_group
);
885 #endif /* defined(CONFIG_SCHED_GRRR_CORE) */
887 #if defined(CONFIG_SCHED_GRRR)
889 static struct grrr_run_queue fs_grrr_runq
;
890 #define FS_GRRR_RUNQ ((processor_t)-2)
891 decl_simple_lock_data(static,fs_grrr_lock
);
894 sched_grrr_fairshare_init(void)
896 grrr_priority_mapping_init();
898 simple_lock_init(&fs_grrr_lock
, 0);
899 grrr_runqueue_init(&fs_grrr_runq
);
904 sched_grrr_fairshare_runq_count(void)
906 return fs_grrr_runq
.count
;
910 sched_grrr_fairshare_runq_stats_count_sum(void)
912 return fs_grrr_runq
.runq_stats
.count_sum
;
916 sched_grrr_fairshare_enqueue(thread_t thread
)
918 simple_lock(&fs_grrr_lock
);
920 (void)grrr_enqueue(&fs_grrr_runq
, thread
);
922 thread
->runq
= FS_GRRR_RUNQ
;
924 simple_unlock(&fs_grrr_lock
);
927 thread_t
sched_grrr_fairshare_dequeue(void)
931 simple_lock(&fs_grrr_lock
);
932 if (fs_grrr_runq
.count
> 0) {
933 thread
= grrr_select(&fs_grrr_runq
);
935 simple_unlock(&fs_grrr_lock
);
939 simple_unlock(&fs_grrr_lock
);
944 boolean_t
sched_grrr_fairshare_queue_remove(thread_t thread
)
947 simple_lock(&fs_grrr_lock
);
949 if (FS_GRRR_RUNQ
== thread
->runq
) {
950 grrr_remove(&fs_grrr_runq
, thread
);
952 simple_unlock(&fs_grrr_lock
);
957 * The thread left the run queue before we could
958 * lock the run queue.
960 assert(thread
->runq
== PROCESSOR_NULL
);
961 simple_unlock(&fs_grrr_lock
);
966 #endif /* defined(CONFIG_SCHED_GRRR) */