In question 2, the creation IRQ flow is configured with a higher priority, unlike jobs. In kernel/irq/manage.c you will see the following code for creating kernel threads for IRQ streaming:
static const struct sched_param param = { .sched_priority = MAX_USER_RT_PRIO/2, }; t = kthread_create(irq_thread, new, "irq/%d-%s", irq, new->name); if (IS_ERR(t)) { ret = PTR_ERR(t); goto out_mput; } sched_setscheduler_nocheck(t, SCHED_FIFO, ¶m);
Here you can see that the kernel thread scheduling policy is set to RT one ( SCHED_FIFO ), and the thread priority is set to MAX_USER_RT_PRIO/2 , which is higher than normal processes.
In question 3, the described situation may also occur during normal interruptions. Typically, kernel interrupts are disabled during ISR execution. During ISR execution, characters can continue to populate the device buffer, and the device can and must continue to acknowledge the interrupt, even when interrupts are disabled.
The device’s task is to ensure that the IRQ string is supported until all characters are read and the ISR processing is complete. It is also important that the interrupt be triggered by the level or depending on the design that was recorded by the interrupt controller.
Finally, the device / peripheral must have a FIFO of sufficient size so that characters transmitted at high speed are not lost in a slow ISR. The ISR should also be designed to read as many characters as possible when it is running.
Actually, what I saw, the controller will have a FIFO of a certain size X , and when the FIFO is filled with X/2 , it will kill the interrupt, which will cause the ISR to run out of data. ISR reads as much as possible and then clears the interrupt. Meanwhile, if the FIFO is still X/2 , the device will support the interrupt string, which will cause the ISR to run again.