linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* doubt on schedule_work() - work task getting scheduled lately
@ 2016-07-29  9:39 Muni Sekhar
  0 siblings, 0 replies; only message in thread
From: Muni Sekhar @ 2016-07-29  9:39 UTC (permalink / raw)
  To: linux-kernel

Hi All,

I have a doubt regarding the workqueue scheduling.

I am using the workqueue for processing the Rx Interrupt data. I am
calling schedule_work() on receiving the Rx interrupt from hardware.

I calculated the time between calling the schedule_work() and
workqueue task actually getting executed, Here I see many cases of
less than 100 us(It is fairly good).

But sometimes I see 10’s of ms and a lot in the 100’s of ms. I have
seen over 0.5 secs too. I would like to know why does sometimes kernel
takes longer time(in milli seconds) to schedule it? Is there any way
to reduce this time gap?


My code:

static void my_workqueuetask(struct work_struct *work)
{
    printk("In %s() \n",__func__);

    mutex_lock(&rx_bh_mutex);

    //Do something here

    mutex_lock(&rx_bh_mutex);
}


static irqreturn_t my_irq_handler(int irq, void *dev)
{
        ……;

        if(Rx Interrupt)
             schedule_work(&rx_work);

return IRQ_HANDLED;
}




-- 
Thanks,
Sekhar

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-07-29  9:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-29  9:39 doubt on schedule_work() - work task getting scheduled lately Muni Sekhar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).