cpudeadline.c (c13aca79ff3c4af5fd31a5b2743a90eba6e36a26) cpudeadline.c (3bd3706251ee8ab67e69d9340ac2abdca217e733)
1/*
2 * kernel/sched/cpudl.c
3 *
4 * Global CPU deadline management
5 *
6 * Author: Juri Lelli <j.lelli@sssup.it>
7 *
8 * This program is free software; you can redistribute it and/or

--- 110 unchanged lines hidden (view full) ---

119 * Returns: int - CPUs were found
120 */
121int cpudl_find(struct cpudl *cp, struct task_struct *p,
122 struct cpumask *later_mask)
123{
124 const struct sched_dl_entity *dl_se = &p->dl;
125
126 if (later_mask &&
1/*
2 * kernel/sched/cpudl.c
3 *
4 * Global CPU deadline management
5 *
6 * Author: Juri Lelli <j.lelli@sssup.it>
7 *
8 * This program is free software; you can redistribute it and/or

--- 110 unchanged lines hidden (view full) ---

119 * Returns: int - CPUs were found
120 */
121int cpudl_find(struct cpudl *cp, struct task_struct *p,
122 struct cpumask *later_mask)
123{
124 const struct sched_dl_entity *dl_se = &p->dl;
125
126 if (later_mask &&
127 cpumask_and(later_mask, cp->free_cpus, &p->cpus_allowed)) {
127 cpumask_and(later_mask, cp->free_cpus, p->cpus_ptr)) {
128 return 1;
129 } else {
130 int best_cpu = cpudl_maximum(cp);
131
132 WARN_ON(best_cpu != -1 && !cpu_present(best_cpu));
133
128 return 1;
129 } else {
130 int best_cpu = cpudl_maximum(cp);
131
132 WARN_ON(best_cpu != -1 && !cpu_present(best_cpu));
133
134 if (cpumask_test_cpu(best_cpu, &p->cpus_allowed) &&
134 if (cpumask_test_cpu(best_cpu, p->cpus_ptr) &&
135 dl_time_before(dl_se->deadline, cp->elements[0].dl)) {
136 if (later_mask)
137 cpumask_set_cpu(best_cpu, later_mask);
138
139 return 1;
140 }
141 }
142 return 0;

--- 134 unchanged lines hidden ---
135 dl_time_before(dl_se->deadline, cp->elements[0].dl)) {
136 if (later_mask)
137 cpumask_set_cpu(best_cpu, later_mask);
138
139 return 1;
140 }
141 }
142 return 0;

--- 134 unchanged lines hidden ---