Skip to content

Commit e739f98

Browse files
KAGA-KOKOPeter Zijlstra
authored andcommitted
genirq: Move prio assignment into the newly created thread
With enabled threaded interrupts the nouveau driver reported the following: | Chain exists of: | &mm->mmap_lock#2 --> &device->mutex --> &cpuset_rwsem | | Possible unsafe locking scenario: | | CPU0 CPU1 | ---- ---- | lock(&cpuset_rwsem); | lock(&device->mutex); | lock(&cpuset_rwsem); | lock(&mm->mmap_lock#2); The device->mutex is nvkm_device::mutex. Unblocking the lockchain at `cpuset_rwsem' is probably the easiest thing to do. Move the priority assignment to the start of the newly created thread. Fixes: 710da3c ("sched/core: Prevent race condition between cpuset and __sched_setscheduler()") Reported-by: Mike Galbraith <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> [bigeasy: Patch description] Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent e1a6af4 commit e739f98

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/irq/manage.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1259,6 +1259,8 @@ static int irq_thread(void *data)
12591259
irqreturn_t (*handler_fn)(struct irq_desc *desc,
12601260
struct irqaction *action);
12611261

1262+
sched_set_fifo(current);
1263+
12621264
if (force_irqthreads() && test_bit(IRQTF_FORCED_THREAD,
12631265
&action->thread_flags))
12641266
handler_fn = irq_forced_thread_fn;
@@ -1424,8 +1426,6 @@ setup_irq_thread(struct irqaction *new, unsigned int irq, bool secondary)
14241426
if (IS_ERR(t))
14251427
return PTR_ERR(t);
14261428

1427-
sched_set_fifo(t);
1428-
14291429
/*
14301430
* We keep the reference to the task struct even if
14311431
* the thread dies to avoid that the interrupt code

0 commit comments

Comments
 (0)