cregit-Linux how code gets into the kernel

Release 4.15 kernel/sched/idle_task.c

Directory: kernel/sched
// SPDX-License-Identifier: GPL-2.0
#include "sched.h"

/*
 * idle-task scheduling class.
 *
 * (NOTE: these are not related to SCHED_IDLE tasks which are
 *  handled in sched/fair.c)
 */

#ifdef CONFIG_SMP

static int select_task_rq_idle(struct task_struct *p, int cpu, int sd_flag, int flags) { return task_cpu(p); /* IDLE tasks as never migrated */ }

Contributors

PersonTokensPropCommitsCommitProp
Gregory Haskins2074.07%120.00%
Peter Zijlstra725.93%480.00%
Total27100.00%5100.00%

#endif /* CONFIG_SMP */ /* * Idle tasks are unconditionally rescheduled: */
static void check_preempt_curr_idle(struct rq *rq, struct task_struct *p, int flags) { resched_curr(rq); }

Contributors

PersonTokensPropCommitsCommitProp
Ingo Molnar2083.33%125.00%
Peter Zijlstra312.50%250.00%
Kirill V Tkhai14.17%125.00%
Total24100.00%4100.00%


static struct task_struct * pick_next_task_idle(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) { put_prev_task(rq, prev); update_idle_core(rq); schedstat_inc(rq->sched_goidle); return rq->idle; }

Contributors

PersonTokensPropCommitsCommitProp
Ingo Molnar2451.06%116.67%
Peter Zijlstra1940.43%350.00%
Matt Fleming36.38%116.67%
Josh Poimboeuf12.13%116.67%
Total47100.00%6100.00%

/* * It is not legal to sleep in the idle task - print a warning * message if some code attempts to do it: */
static void dequeue_task_idle(struct rq *rq, struct task_struct *p, int flags) { raw_spin_unlock_irq(&rq->lock); printk(KERN_ERR "bad: scheduling from the idle thread!\n"); dump_stack(); raw_spin_lock_irq(&rq->lock); }

Contributors

PersonTokensPropCommitsCommitProp
Ingo Molnar3988.64%125.00%
Peter Zijlstra36.82%250.00%
Thomas Gleixner24.55%125.00%
Total44100.00%4100.00%


static void put_prev_task_idle(struct rq *rq, struct task_struct *prev) { rq_last_tick_reset(rq); }

Contributors

PersonTokensPropCommitsCommitProp
Ingo Molnar1466.67%150.00%
Peter Zijlstra733.33%150.00%
Total21100.00%2100.00%


static void task_tick_idle(struct rq *rq, struct task_struct *curr, int queued) { }

Contributors

PersonTokensPropCommitsCommitProp
Ingo Molnar1583.33%150.00%
Peter Zijlstra316.67%150.00%
Total18100.00%2100.00%


static void set_curr_task_idle(struct rq *rq) { }

Contributors

PersonTokensPropCommitsCommitProp
Srivatsa Vaddagiri10100.00%1100.00%
Total10100.00%1100.00%


static void switched_to_idle(struct rq *rq, struct task_struct *p) { BUG(); }

Contributors

PersonTokensPropCommitsCommitProp
Steven Rostedt1789.47%150.00%
Peter Zijlstra210.53%150.00%
Total19100.00%2100.00%


static void prio_changed_idle(struct rq *rq, struct task_struct *p, int oldprio) { BUG(); }

Contributors

PersonTokensPropCommitsCommitProp
Steven Rostedt2090.91%150.00%
Peter Zijlstra29.09%150.00%
Total22100.00%2100.00%


static unsigned int get_rr_interval_idle(struct rq *rq, struct task_struct *task) { return 0; }

Contributors

PersonTokensPropCommitsCommitProp
Peter Williams1470.00%133.33%
Thomas Gleixner525.00%133.33%
H Hartley Sweeten15.00%133.33%
Total20100.00%3100.00%


static void update_curr_idle(struct rq *rq) { }

Contributors

PersonTokensPropCommitsCommitProp
Thomas Gleixner10100.00%1100.00%
Total10100.00%1100.00%

/* * Simple, special scheduling class for the per-CPU idle tasks: */ const struct sched_class idle_sched_class = { /* .next is NULL */ /* no enqueue/yield_task for idle tasks */ /* dequeue is not valid, we print a debug message there: */ .dequeue_task = dequeue_task_idle, .check_preempt_curr = check_preempt_curr_idle, .pick_next_task = pick_next_task_idle, .put_prev_task = put_prev_task_idle, #ifdef CONFIG_SMP .select_task_rq = select_task_rq_idle, .set_cpus_allowed = set_cpus_allowed_common, #endif .set_curr_task = set_curr_task_idle, .task_tick = task_tick_idle, .get_rr_interval = get_rr_interval_idle, .prio_changed = prio_changed_idle, .switched_to = switched_to_idle, .update_curr = update_curr_idle, };

Overall Contributors

PersonTokensPropCommitsCommitProp
Ingo Molnar15042.74%25.88%
Peter Zijlstra5415.38%1544.12%
Steven Rostedt4613.11%12.94%
Gregory Haskins267.41%12.94%
Peter Williams257.12%38.82%
Thomas Gleixner226.27%38.82%
Srivatsa Vaddagiri154.27%12.94%
Li Zefan41.14%12.94%
Matt Fleming30.85%12.94%
Kirill V Tkhai10.28%12.94%
Greg Kroah-Hartman10.28%12.94%
Borislav Petkov10.28%12.94%
H Hartley Sweeten10.28%12.94%
Hiroshi Shimamoto10.28%12.94%
Josh Poimboeuf10.28%12.94%
Total351100.00%34100.00%
Directory: kernel/sched
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.