cregit-Linux how code gets into the kernel

Release 4.15 kernel/sched/stop_task.c

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

/*
 * stop-task scheduling class.
 *
 * The stop task is the highest priority task in the system, it preempts
 * everything and will be preempted by nothing.
 *
 * See kernel/stop_machine.c
 */

#ifdef CONFIG_SMP

static int select_task_rq_stop(struct task_struct *p, int cpu, int sd_flag, int flags) { return task_cpu(p); /* stop tasks as never migrate */ }

Contributors

PersonTokensPropCommitsCommitProp
Peter Zijlstra27100.00%2100.00%
Total27100.00%2100.00%

#endif /* CONFIG_SMP */
static void check_preempt_curr_stop(struct rq *rq, struct task_struct *p, int flags) { /* we're never preempted */ }

Contributors

PersonTokensPropCommitsCommitProp
Peter Zijlstra20100.00%2100.00%
Total20100.00%2100.00%


static struct task_struct * pick_next_task_stop(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) { struct task_struct *stop = rq->stop; if (!stop || !task_on_rq_queued(stop)) return NULL; put_prev_task(rq, prev); stop->se.exec_start = rq_clock_task(rq); return stop; }

Contributors

PersonTokensPropCommitsCommitProp
Peter Zijlstra4973.13%342.86%
Mike Galbraith913.43%114.29%
Matt Fleming34.48%114.29%
Frédéric Weisbecker34.48%114.29%
Kirill Tkhai34.48%114.29%
Total67100.00%7100.00%


static void enqueue_task_stop(struct rq *rq, struct task_struct *p, int flags) { add_nr_running(rq, 1); }

Contributors

PersonTokensPropCommitsCommitProp
Peter Zijlstra1765.38%133.33%
Paul Turner623.08%133.33%
Kirill V Tkhai311.54%133.33%
Total26100.00%3100.00%


static void dequeue_task_stop(struct rq *rq, struct task_struct *p, int flags) { sub_nr_running(rq, 1); }

Contributors

PersonTokensPropCommitsCommitProp
Peter Zijlstra1765.38%133.33%
Paul Turner623.08%133.33%
Kirill V Tkhai311.54%133.33%
Total26100.00%3100.00%


static void yield_task_stop(struct rq *rq) { BUG(); /* the stop task should never yield, its pointless. */ }

Contributors

PersonTokensPropCommitsCommitProp
Peter Zijlstra15100.00%1100.00%
Total15100.00%1100.00%


static void put_prev_task_stop(struct rq *rq, struct task_struct *prev) { struct task_struct *curr = rq->curr; u64 delta_exec; delta_exec = rq_clock_task(rq) - curr->se.exec_start; if (unlikely((s64)delta_exec < 0)) delta_exec = 0; schedstat_set(curr->se.statistics.exec_max, max(curr->se.statistics.exec_max, delta_exec)); curr->se.sum_exec_runtime += delta_exec; account_group_exec_runtime(curr, delta_exec); curr->se.exec_start = rq_clock_task(rq); cgroup_account_cputime(curr, delta_exec); }

Contributors

PersonTokensPropCommitsCommitProp
Mike Galbraith9381.58%125.00%
Peter Zijlstra1412.28%125.00%
Frédéric Weisbecker65.26%125.00%
Tejun Heo10.88%125.00%
Total114100.00%4100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Peter Zijlstra18100.00%1100.00%
Total18100.00%1100.00%


static void set_curr_task_stop(struct rq *rq) { struct task_struct *stop = rq->stop; stop->se.exec_start = rq_clock_task(rq); }

Contributors

PersonTokensPropCommitsCommitProp
Mike Galbraith1961.29%133.33%
Peter Zijlstra929.03%133.33%
Frédéric Weisbecker39.68%133.33%
Total31100.00%3100.00%


static void switched_to_stop(struct rq *rq, struct task_struct *p) { BUG(); /* its impossible to change to this class */ }

Contributors

PersonTokensPropCommitsCommitProp
Peter Zijlstra20100.00%1100.00%
Total20100.00%1100.00%


static void prio_changed_stop(struct rq *rq, struct task_struct *p, int oldprio) { BUG(); /* how!?, what priority? */ }

Contributors

PersonTokensPropCommitsCommitProp
Peter Zijlstra23100.00%1100.00%
Total23100.00%1100.00%


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

Contributors

PersonTokensPropCommitsCommitProp
Peter Zijlstra20100.00%1100.00%
Total20100.00%1100.00%


static void update_curr_stop(struct rq *rq) { }

Contributors

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

/* * Simple, special scheduling class for the per-CPU stop tasks: */ const struct sched_class stop_sched_class = { .next = &dl_sched_class, .enqueue_task = enqueue_task_stop, .dequeue_task = dequeue_task_stop, .yield_task = yield_task_stop, .check_preempt_curr = check_preempt_curr_stop, .pick_next_task = pick_next_task_stop, .put_prev_task = put_prev_task_stop, #ifdef CONFIG_SMP .select_task_rq = select_task_rq_stop, .set_cpus_allowed = set_cpus_allowed_common, #endif .set_curr_task = set_curr_task_stop, .task_tick = task_tick_stop, .get_rr_interval = get_rr_interval_stop, .prio_changed = prio_changed_stop, .switched_to = switched_to_stop, .update_curr = update_curr_stop, };

Overall Contributors

PersonTokensPropCommitsCommitProp
Peter Zijlstra34165.96%738.89%
Mike Galbraith12123.40%15.56%
Thomas Gleixner152.90%15.56%
Paul Turner122.32%15.56%
Frédéric Weisbecker122.32%15.56%
Kirill V Tkhai61.16%15.56%
Kirill Tkhai30.58%15.56%
Matt Fleming30.58%15.56%
Greg Kroah-Hartman10.19%15.56%
Tejun Heo10.19%15.56%
Dario Faggioli10.19%15.56%
Borislav Petkov10.19%15.56%
Total517100.00%18100.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.