Skip to content

Commit f22e08a

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 Ingo Molnar. * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched: Fix incorrect usage of for_each_cpu_mask() in select_fallback_rq() sched: Fix __schedule_bug() output when called from an interrupt sched/arch: Introduce the finish_arch_post_lock_switch() scheduler callback
2 parents f187e9f + e3831ed commit f22e08a

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

kernel/sched/core.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,7 @@ static int select_fallback_rq(int cpu, struct task_struct *p)
12701270
int dest_cpu;
12711271

12721272
/* Look for allowed, online CPU in same node. */
1273-
for_each_cpu_mask(dest_cpu, *nodemask) {
1273+
for_each_cpu(dest_cpu, nodemask) {
12741274
if (!cpu_online(dest_cpu))
12751275
continue;
12761276
if (!cpu_active(dest_cpu))
@@ -1281,7 +1281,7 @@ static int select_fallback_rq(int cpu, struct task_struct *p)
12811281

12821282
for (;;) {
12831283
/* Any allowed, online CPU? */
1284-
for_each_cpu_mask(dest_cpu, *tsk_cpus_allowed(p)) {
1284+
for_each_cpu(dest_cpu, tsk_cpus_allowed(p)) {
12851285
if (!cpu_online(dest_cpu))
12861286
continue;
12871287
if (!cpu_active(dest_cpu))
@@ -1964,6 +1964,7 @@ static void finish_task_switch(struct rq *rq, struct task_struct *prev)
19641964
local_irq_enable();
19651965
#endif /* __ARCH_WANT_INTERRUPTS_ON_CTXSW */
19661966
finish_lock_switch(rq, prev);
1967+
finish_arch_post_lock_switch();
19671968

19681969
fire_sched_in_preempt_notifiers(current);
19691970
if (mm)
@@ -3101,8 +3102,6 @@ EXPORT_SYMBOL(sub_preempt_count);
31013102
*/
31023103
static noinline void __schedule_bug(struct task_struct *prev)
31033104
{
3104-
struct pt_regs *regs = get_irq_regs();
3105-
31063105
if (oops_in_progress)
31073106
return;
31083107

@@ -3113,11 +3112,7 @@ static noinline void __schedule_bug(struct task_struct *prev)
31133112
print_modules();
31143113
if (irqs_disabled())
31153114
print_irqtrace_events(prev);
3116-
3117-
if (regs)
3118-
show_regs(regs);
3119-
else
3120-
dump_stack();
3115+
dump_stack();
31213116
}
31223117

31233118
/*

kernel/sched/sched.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,9 @@ static inline int task_running(struct rq *rq, struct task_struct *p)
681681
#ifndef finish_arch_switch
682682
# define finish_arch_switch(prev) do { } while (0)
683683
#endif
684+
#ifndef finish_arch_post_lock_switch
685+
# define finish_arch_post_lock_switch() do { } while (0)
686+
#endif
684687

685688
#ifndef __ARCH_WANT_UNLOCKED_CTXSW
686689
static inline void prepare_lock_switch(struct rq *rq, struct task_struct *next)

0 commit comments

Comments
 (0)