On 2/14/06, Mukund JB. <mukundjb@xxxxxxxxxxxxxxxxxxxxx> wrote: > HI Gautam, > > >> I am working on a Block driver. I am required to do a pretty heavy > >> computation in the interrupt context. > >> > >> I tried to schedule the kernel work queue in the driver from the > >> bottomhalf. > >> It works. > >> > >> As Tasklet is the next high priority job after interrupts, I suspect > if > >> anything is wrong in incorporating this method. > >> Please see the pseudo code below. > >> > >> Pseudo code > >> ------------ > >> /* ISR */ > >> intsrv() > >> { > >> ...... > >> tasklet_schedule(&tlet); > >> } > >> > >> /* bottom half */ > >> static void bottomhalf(ulong vptr) > >> { > >> ...... > >> ...... > >> schedule_work(&tqueue); /* call to Work queue */ > >> } > >> > > > >as far as I can understand, you are sheduling the tasklet, which is > >just responsible to further shedule the work on work queue. Why dont > >you directly do your pending work in tasklet itself. > > That is where I used to do that earlier (in taskelet). It created some > delay. > I assume the tasklet is high priority job that task queue. > So, I used it assuming it gives control to the console faster. > I think I am able to see some small difference in getting the control > over the console little bit faster than usual. you are right, interrupts context will not return unless all all tasklets are not run or syste call will not return if unless all tasklets are not run ..... that puts a panelty of putting heavy tasklet, as that will delay the system call return or interrupt call, affecting the performace of system. You are doing the right thing by scheduling the work onm work queue. Actually work queue is run is process context and there is dedicated kernel thread to process these sheduled works, due to which system performance does not affect much. When that kernel thread will be scheduled, our work will be done. I would suggest you not to schedule the tasklet from interrupt context, ratehr directly schedule the work on workqueue from interrupt context. What you say ?? -Guarav > > Regards, > Mukund Jampala > > >> This is how it works and finally the assigned work queue function > will > >> be called. Please give your ideas on this kind of an approach. > >> > >> Regards, > >> Mukund Jampala > >> > >> > > -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/