2005-05-16 15:22:38

by Dinesh Ahuja

[permalink] [raw]
Subject: Share Wait Queue between different modules ?

Hi ,

Just trying to explore a situation where different
modules may need to share same wait queues. Could
anyone tell me the pratical situation where we need to
have above mentioned situation ?

Please clarify me on below point :
We say that kernel stack is very much limited around
8KB.
Does all the running processes share this stack or
each process has 8KB of the space which process can
access when it is running in kernel mode.

Sharing wait queues will be difficult if the kernel
space is 8KB for all the ready processes because then
the no of wait_queue_t elements which can be added
will be limited.

Please clear my concepts over this .

Regards
Dinesh

________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony


2005-05-16 17:02:27

by Steven Rostedt

[permalink] [raw]
Subject: Re: Share Wait Queue between different modules ?

On Mon, 2005-05-16 at 16:11 +0100, Dinesh Ahuja wrote:
> Hi ,
>
> Just trying to explore a situation where different
> modules may need to share same wait queues. Could
> anyone tell me the pratical situation where we need to
> have above mentioned situation ?
>

Have an example of this situation?

> Please clarify me on below point :
> We say that kernel stack is very much limited around
> 8KB.
> Does all the running processes share this stack or
> each process has 8KB of the space which process can
> access when it is running in kernel mode.
>

The later. Each process has its own kernel stack when in kernel mode.

> Sharing wait queues will be difficult if the kernel
> space is 8KB for all the ready processes because then
> the no of wait_queue_t elements which can be added
> will be limited.
>

As mentioned above, each process has its own kernel stack.


-- Steve


2005-05-18 15:05:35

by Dinesh Ahuja

[permalink] [raw]
Subject: Re: Share Wait Queue between different modules ?

Thanks Steven for answer.

Could please tell me know how to share wait queue
between different modules and where will be pratical
implementation of that case.

Regards
Dinesh

--- Steven Rostedt <[email protected]> wrote:
> On Mon, 2005-05-16 at 16:11 +0100, Dinesh Ahuja
> wrote:
> > Hi ,
> >
> > Just trying to explore a situation where different
> > modules may need to share same wait queues. Could
> > anyone tell me the pratical situation where we
> need to
> > have above mentioned situation ?
> >
>
> Have an example of this situation?
>
> > Please clarify me on below point :
> > We say that kernel stack is very much limited
> around
> > 8KB.
> > Does all the running processes share this stack or
> > each process has 8KB of the space which process
> can
> > access when it is running in kernel mode.
> >
>
> The later. Each process has its own kernel stack
> when in kernel mode.
>
> > Sharing wait queues will be difficult if the
> kernel
> > space is 8KB for all the ready processes because
> then
> > the no of wait_queue_t elements which can be added
> > will be limited.
> >
>
> As mentioned above, each process has its own kernel
> stack.
>
>
> -- Steve
>
>
>

________________________________________________________________________
Yahoo! India Matrimony: Find your life partner online
Go to: http://yahoo.shaadi.com/india-matrimony

2005-05-18 15:48:50

by Steven Rostedt

[permalink] [raw]
Subject: Re: Share Wait Queue between different modules ?

On Wed, 2005-05-18 at 16:02 +0100, Dinesh Ahuja wrote:
> Thanks Steven for answer.
>
> Could please tell me know how to share wait queue
> between different modules and where will be pratical
> implementation of that case.

A wait_queue is where a task goes while waiting for some event. If you
want to share it among modules you first need to determine where the
wait queue would be declared. If module A and module B use the same
wait queue, and module A has declared it. Then module B would be
dependent on module A. Module A would also have to export the wait
queue via the EXPORT_SYMBOL macro. Or, the wait queue can be declared
in the kernel itself and all modules can use it.

As for a practical implementation for doing this, I'm not sure what you
are asking for since the question itself is quite abstract. I haven't
needed to export a wait queue from one module to the next. The best I
can tell you is if one module supplies some functionality or driver for
some device that has a wait queue for some event, and another module
adds functionality or a sub system of the device that needs to have
tasks wait on the same event, then I guess that would be one case.

-- Steve