Lines Matching refs:prev
5014 static inline void finish_task(struct task_struct *prev) in finish_task() argument
5028 smp_store_release(&prev->on_cpu, 0); in finish_task()
5205 prepare_task_switch(struct rq *rq, struct task_struct *prev, in prepare_task_switch() argument
5208 kcov_prepare_switch(prev); in prepare_task_switch()
5209 sched_info_switch(rq, prev, next); in prepare_task_switch()
5210 perf_event_task_sched_out(prev, next); in prepare_task_switch()
5211 rseq_preempt(prev); in prepare_task_switch()
5212 fire_sched_out_preempt_notifiers(prev, next); in prepare_task_switch()
5237 static struct rq *finish_task_switch(struct task_struct *prev) in finish_task_switch() argument
5273 prev_state = READ_ONCE(prev->__state); in finish_task_switch()
5274 vtime_task_switch(prev); in finish_task_switch()
5275 perf_event_task_sched_in(prev, current); in finish_task_switch()
5276 finish_task(prev); in finish_task_switch()
5308 if (prev->sched_class->task_dead) in finish_task_switch()
5309 prev->sched_class->task_dead(prev); in finish_task_switch()
5311 trace_android_rvh_flush_task(prev); in finish_task_switch()
5314 put_task_stack(prev); in finish_task_switch()
5316 put_task_struct_rcu_user(prev); in finish_task_switch()
5326 asmlinkage __visible void schedule_tail(struct task_struct *prev) in schedule_tail() argument
5338 finish_task_switch(prev); in schedule_tail()
5351 context_switch(struct rq *rq, struct task_struct *prev, in context_switch() argument
5354 prepare_task_switch(rq, prev, next); in context_switch()
5361 arch_start_context_switch(prev); in context_switch()
5371 enter_lazy_tlb(prev->active_mm, next); in context_switch()
5373 next->active_mm = prev->active_mm; in context_switch()
5374 if (prev->mm) // from user in context_switch()
5375 mmgrab(prev->active_mm); in context_switch()
5377 prev->active_mm = NULL; in context_switch()
5379 membarrier_switch_mm(rq, prev->active_mm, next->mm); in context_switch()
5388 switch_mm_irqs_off(prev->active_mm, next->mm, next); in context_switch()
5391 if (!prev->mm) { // from kernel in context_switch()
5393 rq->prev_mm = prev->active_mm; in context_switch()
5394 prev->active_mm = NULL; in context_switch()
5403 switch_to(prev, next, prev); in context_switch()
5406 return finish_task_switch(prev); in context_switch()
5936 static noinline void __schedule_bug(struct task_struct *prev) in __schedule_bug() argument
5945 prev->comm, prev->pid, preempt_count()); in __schedule_bug()
5947 debug_show_held_locks(prev); in __schedule_bug()
5950 print_irqtrace_events(prev); in __schedule_bug()
5958 trace_android_rvh_schedule_bug(prev); in __schedule_bug()
5967 static inline void schedule_debug(struct task_struct *prev, bool preempt) in schedule_debug() argument
5970 if (task_stack_end_corrupted(prev)) in schedule_debug()
5973 if (task_scs_end_corrupted(prev)) in schedule_debug()
5978 if (!preempt && READ_ONCE(prev->__state) && prev->non_block_count) { in schedule_debug()
5980 prev->comm, prev->pid, prev->non_block_count); in schedule_debug()
5987 __schedule_bug(prev); in schedule_debug()
5998 static void put_prev_task_balance(struct rq *rq, struct task_struct *prev, in put_prev_task_balance() argument
6011 for_class_range(class, prev->sched_class, &idle_sched_class) { in put_prev_task_balance()
6012 if (class->balance(rq, prev, rf)) in put_prev_task_balance()
6017 put_prev_task(rq, prev); in put_prev_task_balance()
6024 __pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) in __pick_next_task() argument
6035 if (likely(!sched_class_above(prev->sched_class, &fair_sched_class) && in __pick_next_task()
6038 p = pick_next_task_fair(rq, prev, rf); in __pick_next_task()
6044 put_prev_task(rq, prev); in __pick_next_task()
6052 put_prev_task_balance(rq, prev, rf); in __pick_next_task()
6101 pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) in pick_next_task() argument
6113 return __pick_next_task(rq, prev, rf); in pick_next_task()
6125 return __pick_next_task(rq, prev, rf); in pick_next_task()
6143 if (next != prev) { in pick_next_task()
6144 put_prev_task(rq, prev); in pick_next_task()
6152 put_prev_task_balance(rq, prev, rf); in pick_next_task()
6545 pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) in pick_next_task() argument
6547 return __pick_next_task(rq, prev, rf); in pick_next_task()
6611 struct task_struct *prev, *next; in __schedule() local
6620 prev = rq->curr; in __schedule()
6622 schedule_debug(prev, !!sched_mode); in __schedule()
6652 switch_count = &prev->nivcsw; in __schedule()
6658 prev_state = READ_ONCE(prev->__state); in __schedule()
6660 if (signal_pending_state(prev_state, prev)) { in __schedule()
6661 WRITE_ONCE(prev->__state, TASK_RUNNING); in __schedule()
6663 prev->sched_contributes_to_load = in __schedule()
6668 if (prev->sched_contributes_to_load) in __schedule()
6682 deactivate_task(rq, prev, DEQUEUE_SLEEP | DEQUEUE_NOCLOCK); in __schedule()
6684 if (prev->in_iowait) { in __schedule()
6689 switch_count = &prev->nvcsw; in __schedule()
6692 next = pick_next_task(rq, prev, &rf); in __schedule()
6693 clear_tsk_need_resched(prev); in __schedule()
6699 trace_android_rvh_schedule(sched_mode, prev, next, rq); in __schedule()
6700 if (likely(prev != next)) { in __schedule()
6723 migrate_disable_switch(rq, prev); in __schedule()
6724 psi_sched_switch(prev, next, !task_on_rq_queued(prev)); in __schedule()
6726 trace_sched_switch(sched_mode & SM_MASK_PREEMPT, prev, next, prev_state); in __schedule()
6729 rq = context_switch(rq, prev, next, &rf); in __schedule()