Skip to content

Commit cc71efd

Browse files
committed
Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull scheduler fixes from Thomas Gleixner: "Three fixes for scheduler and kthread code: - allow calling kthread_park() on an already parked thread - restore the sched_pi_setprio() tracepoint behaviour - clarify the unclear string for the scheduling domain debug output" * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched, tracing: Fix trace_sched_pi_setprio() for deboosting kthread: Allow kthread_park() on a parked kthread sched/topology: Clarify root domain(s) debug string
2 parents ec30dcf + 4ff648d commit cc71efd

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

include/trace/events/sched.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,9 @@ TRACE_EVENT(sched_pi_setprio,
435435
memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN);
436436
__entry->pid = tsk->pid;
437437
__entry->oldprio = tsk->prio;
438-
__entry->newprio = pi_task ? pi_task->prio : tsk->prio;
438+
__entry->newprio = pi_task ?
439+
min(tsk->normal_prio, pi_task->prio) :
440+
tsk->normal_prio;
439441
/* XXX SCHED_DEADLINE bits missing */
440442
),
441443

kernel/kthread.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ EXPORT_SYMBOL_GPL(kthread_parkme);
193193

194194
void kthread_park_complete(struct task_struct *k)
195195
{
196-
complete(&to_kthread(k)->parked);
196+
complete_all(&to_kthread(k)->parked);
197197
}
198198

199199
static int kthread(void *_create)
@@ -459,6 +459,7 @@ void kthread_unpark(struct task_struct *k)
459459
if (test_bit(KTHREAD_IS_PER_CPU, &kthread->flags))
460460
__kthread_bind(k, kthread->cpu, TASK_PARKED);
461461

462+
reinit_completion(&kthread->parked);
462463
clear_bit(KTHREAD_SHOULD_PARK, &kthread->flags);
463464
wake_up_state(k, TASK_PARKED);
464465
}
@@ -483,9 +484,6 @@ int kthread_park(struct task_struct *k)
483484
if (WARN_ON(k->flags & PF_EXITING))
484485
return -ENOSYS;
485486

486-
if (WARN_ON_ONCE(test_bit(KTHREAD_SHOULD_PARK, &kthread->flags)))
487-
return -EBUSY;
488-
489487
set_bit(KTHREAD_SHOULD_PARK, &kthread->flags);
490488
if (k != current) {
491489
wake_up_process(k);

kernel/sched/topology.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1708,7 +1708,7 @@ build_sched_domains(const struct cpumask *cpu_map, struct sched_domain_attr *att
17081708
rcu_read_unlock();
17091709

17101710
if (rq && sched_debug_enabled) {
1711-
pr_info("span: %*pbl (max cpu_capacity = %lu)\n",
1711+
pr_info("root domain span: %*pbl (max cpu_capacity = %lu)\n",
17121712
cpumask_pr_args(cpu_map), rq->rd->max_cpu_capacity);
17131713
}
17141714

0 commit comments

Comments
 (0)