1

I understand by request_irq we can schedule a work_queue where as by request_threaded_irq we can spawn a kthread as bottom half of interrupt. But is not workqueue and kthread more or less the same ? How can request_threaded_irq have better latency then request_irq ?

Saurabh Sengar
  • 878
  • 2
  • 12
  • 20
  • 2
    It's not easy question to answer. Have you read anything regarding soft IRQ handlers? https://lwn.net/Articles/520076/ as a starer. https://lwn.net/Articles/302043/ is more regarding to your topic. – 0andriy Oct 16 '15 at 16:37
  • Is [this](http://stackoverflow.com/a/8188659/3866447) answers your question? – Sam Protsenko Oct 18 '15 at 10:56
  • I have gone through above links(all three) multiple times, but these links doesn't give the satisfactory explanation of why kthread is better then workqueue ? Only think they tell about is quick_check handler which I understand but doesn't tells about how the latency is improved – Saurabh Sengar Oct 21 '15 at 07:11

1 Answers1

0

That's a real-time kernel thread, with a priority of 50

    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, &param);

http://blog.csdn.net/leesagacious/article/details/78876848

leesagacious
  • 182
  • 1
  • 8