Tasklets vs. Task Queues for Deferred Processing

Tasklets vs. Task Queues for Deferred Processing

Post by J S » Sun, 30 Mar 2003 01:20:14



I'm trying to defer some processing to a later point.  I'm in a softirq,
so in_interrupt() returns true.  I need to schedule some work for later,
in process context.  I have read in the O'Reilly linux device drivers
book that tasklets always run in interrupt time.  Also, I guess the only
task_queue that is in process context is the scheduler task queue.  I've
seen in a few places that task queues are on their way out and tasklets
are being used instead.  Is this completely true?  Should I consider
task queues as a deprecated method of deferred processing?`  What other
deferred processing methods can I use that will run in process context?

Thanks,
        Josh

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

Tasklets vs. Task Queues for Deferred Processing

Post by Juergen Quad » Sun, 30 Mar 2003 10:20:05



> I'm trying to defer some processing to a later point.  I'm in a softirq,
> so in_interrupt() returns true.  I need to schedule some work for later,
> in process context.  I have read in the O'Reilly linux device drivers
> book that tasklets always run in interrupt time.  Also, I guess the only
> task_queue that is in process context is the scheduler task queue.  I've
> seen in a few places that task queues are on their way out and tasklets
> are being used instead.  Is this completely true?  Should I consider

True.

Quote:> task queues as a deprecated method of deferred processing?`  What other
> deferred processing methods can I use that will run in process context?

Beside application triggered driver functions (open, close, read,
write ...) you can (only) use kernel threads.
You can use "pure" kernel threads, workqueues or especially the
kevent-daemon (2.4.x) or the event-workqueue (2.5.x).

If you only need to call something like a short function, use
the work queue. Need more info?

        Juergen.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

Tasklets vs. Task Queues for Deferred Processing

Post by Duncan Sand » Sun, 30 Mar 2003 10:20:06



Quote:> I'm trying to defer some processing to a later point.  I'm in a softirq,
> so in_interrupt() returns true.  I need to schedule some work for later,
> in process context.  I have read in the O'Reilly linux device drivers
> book that tasklets always run in interrupt time.  Also, I guess the only
> task_queue that is in process context is the scheduler task queue.  I've
> seen in a few places that task queues are on their way out and tasklets
> are being used instead.  Is this completely true?  Should I consider
> task queues as a deprecated method of deferred processing?`  What other
> deferred processing methods can I use that will run in process context?

In 2.5, use a workqueue.

Duncan.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

Tasklets vs. Task Queues for Deferred Processing

Post by Jonathan Corb » Sun, 30 Mar 2003 23:50:17


Quote:> I have read in the O'Reilly linux device drivers
> book that tasklets always run in interrupt time.  Also, I guess the only
> task_queue that is in process context is the scheduler task queue.  I've
> seen in a few places that task queues are on their way out and tasklets
> are being used instead.  Is this completely true?

All true.  If you're developing for 2.4, you can use schedule_task() and
life will be OK.  For 2.5, you really want to use work queues instead; see
http://lwn.net/Articles/23634/ for a description of how to do that.

jon

Jonathan Corbet
Executive editor, LWN.net

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. problem while putting task in task queue!!

following is a simple code i have written to queue a task.  the code
gets compiled but while inserting it gives the error

unresolved symbol tqueue_lock

I have included a variety of header files.... do i need to give some
compile time linking ? the tqueue_lock does not exit in my symbol
table (ksyms -a) . how do i put that in it ?

*************************************************************************
#define MODULE
#include<linux/module.h>
#include<linux/sched.h>
#include<linux/tqueue.h>
#include<linux/netdevice.h>
#include<linux/spinlock.h>
#include<linux/param.h>
#include<linux/interrupt.h>

  struct tq_struct mytask1,mytask2;

void print_mess1()
{

        printk("<1> in timer function mess1\n");

void print_mess2()
{

        printk("<1> in timer function mess2\n");

int put_task()
{

/*        mytask1.routine=print_mess1;

        mark_bh(TIMER_BH);

        queue_task(&mytask1,&tq_timer);
*/
        mytask2.routine=print_mess2;
        mytask2.data=NULL;
        mark_bh(IMMEDIATE_BH);

        queue_task(&mytask2,&tq_immediate);

         return 0;

 int init_module(void)
 {

        int i;
        printk("<1> inserting module for task\n");

        i = put_task();

        return 0;

  }

  void cleanup_module(void)
  {

     printk("<1> unloading today\n");

  }

2. kernel/process bug in pl9?

3. interrupt, task queue and wait queue.

4. I need help in configuring xconfig 'Clocks' for my video card

5. Posix queues vs. System V queues

6. how to include C++ sstream?

7. Real-Time task vs. device driver vs. sched_setscheduler?

8. But I thought I was using FreeBSD?

9. tasklets, wait_queues and interrupted kernel processes

10. How to get sendmail to process "Deferred" messages

11. kernel_thread vs tasklet/bottom half

12. How does Linux handle no processes in the run queue (Sentinel process?)

13. Linux vs OS2 vs NT vs Win95 vs Multics vs PDP11 vs BSD geeks