problem while putting task in task queue!!

problem while putting task in task queue!!

Post by and » Tue, 23 Oct 2001 22:42:24



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");

Quote:}

void print_mess2()
{

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

Quote:}

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;

Quote:}

 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");

  }

 
 
 

problem while putting task in task queue!!

Post by Kasper Dupon » Tue, 23 Oct 2001 22:57:51



> 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

I would replace that line with these six lines:

#ifndef __KERNEL__
#define __KERNEL__
#endif
#ifndef MODULE
#define MODULE
#endif

But I don't think that is the real problem. Which
kernel version do you use? Are you compiling the
module against the correct header files? Do you
remember to compile with optimization? (-O2) This
might also be a symbol version problem, but I'm
not sure how to deal with them.

--
Kasper Dupont

 
 
 

problem while putting task in task queue!!

Post by and » Wed, 24 Oct 2001 12:29:11


Quote:>But I don't think that is the real problem. Which

kernel version do you use?
MY KERNEL VERSION IS 2.4.2 ,

Quote:> Are you compiling themodule against the correct header files?

I AM COMPILING AGAINST ALL THE RELEVANT HEADER FILES.

Quote:> Do you remember to compile with optimization? (-O2)

I CUD NOT GET THIS ...CUD U PLEASE ELABORATE.!

Quote:>This might also be a symbol version problem, but I'm

not sure how to deal with them.


> > 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

> I would replace that line with these six lines:

> #ifndef __KERNEL__
> #define __KERNEL__
> #endif
> #ifndef MODULE
> #define MODULE
> #endif

> But I don't think that is the real problem. Which
> kernel version do you use? Are you compiling the
> module against the correct header files? Do you
> remember to compile with optimization? (-O2) This
> might also be a symbol version problem, but I'm
> not sure how to deal with them.

 
 
 

problem while putting task in task queue!!

Post by Michael Muelle » Thu, 25 Oct 2001 06:38:32


Hi andy,


> 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 ?

Could it be that you
- use a distribution holding a seperate copy of the kernel header files
in /usr/include/linux and
- does define CONFIG_SMP in /usr/include/linux/autoconf.h?

You are running a uniprocessor kernel (tqueue_lock not defined, nor
exported; see /usr/src/linux/kernel/ksyms.c for later). But in above
case you compile your module for a SMP system. Use following for
compiling your module then:

gcc -I/usr/src/linux/include -D__KERNEL__ -DMODULE -O2 -c yoursource.c

This should convince the compiler to look at the right place for the
header files.

Michael

 
 
 

1. interrupt, task queue and wait queue.

Hi all..

I have a very interesting problem. Currently, I am using the bottom half of
the interrupt to wake up a wait queue element waiting in the read() routine.

This is how I implement the bottom half:

1)The interrupt routine stored relevent data in the immidiate queue and
activate the bottom half.

2)The immediate queue function look at a bit that is atomically set by the
read routine just before the read routine going to sleep on a wait queue. If
the bit is set, it calls wake_up_interruptible on the wait_q that is wait
upon by the read routine. If the bit is not set, it queue the relevant data
in the schedule queue.

3) The schedule queue than constantly check the atomic bit that should be
set by the read routine. If the bit is not set, it would recursively queue
the data to itself(reschedule itself).

The problem is that the schedule queue runs at the interrupt time. As a
result, the other functions such as the read routine is not runned any more
and the calling function and the driver now runs in a loop. I also know that
the schedule queue can also run in the non-interrupt time. If the schedule
queue is runned in the non-interrupt time, I believe that it would give up
the cpu time and allow other processes to run.  Any one has any ideas??

Furthermore, this problem is mainly a question of dealing with the interrupt
arriving before the wake_up_interruptable() in a read() routine is prepared
to be waked up by the bottom half of the interrupt handle and perform
reading. Since I'm new a writing interrupts and Linux, does any know of a
"general" way of handling this problem.

thanks

Peter

2. achive top in solaris

3. Task States; can't kill 'D' tasks

4. RealTek Enet Card working on any distro?

5. Ignoring tasks by task bar

6. Accessing second level network via linksys router and linux box

7. converting Outlook tasks to StarOffice tasks?

8. Solaris Server Hung - Pls help!

9. I'm confused about task queues

10. 2.0.35 message: task not on run-queue

11. Q: multiple task queues performance ?

12. task queues

13. Putting a task onto a wait qeue