* Re: Linux Kernel generic question (procedure queue)
2003-05-06 6:44 None Atall
@ 2003-05-06 6:01 ` Der Herr Hofrat
2003-05-06 7:20 ` Vladimir Gurevich
1 sibling, 0 replies; 6+ messages in thread
From: Der Herr Hofrat @ 2003-05-06 6:01 UTC (permalink / raw)
To: None Atall; +Cc: linuxppc-embedded
>
> Hello everybody,
> Is it possible to insert
> a specific procedure (among with it's args) to the
> kernel scheduler? I know that we can just call
> schedule(); when we wait for an asychronus input or
> we can even insert an interrupt to the kernel queue,
> but is it possible to queue a procedure?
not realy the same effect but you could use a tasklet and call
tasklet_schedule(&write_byte_tasklet);
where the write_bytee tasklet is nothing else but your write_byte function.
> Just for understanding the problem better, I have
> a function write_buff that calls write_byte.
> Write_byte
> function uses PPC gpio for implementing something like
> an SPI interface. When we write a big file (e.x 1M),
> the system will not respond to anything until the
> transfer is done. I inserted "schedule();" every time
> the write_byte is called so that the system will
> accually perform some other tasks. So my question is
> if I could insert write_byte function to the scheduler
> queue in such a way to prevent this problem.
hofrat
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Linux Kernel generic question (procedure queue)
@ 2003-05-06 6:44 None Atall
2003-05-06 6:01 ` Der Herr Hofrat
2003-05-06 7:20 ` Vladimir Gurevich
0 siblings, 2 replies; 6+ messages in thread
From: None Atall @ 2003-05-06 6:44 UTC (permalink / raw)
To: linuxppc-embedded
Hello everybody,
Is it possible to insert
a specific procedure (among with it's args) to the
kernel scheduler? I know that we can just call
schedule(); when we wait for an asychronus input or
we can even insert an interrupt to the kernel queue,
but is it possible to queue a procedure?
Just for understanding the problem better, I have
a function write_buff that calls write_byte.
Write_byte
function uses PPC gpio for implementing something like
an SPI interface. When we write a big file (e.x 1M),
the system will not respond to anything until the
transfer is done. I inserted "schedule();" every time
the write_byte is called so that the system will
accually perform some other tasks. So my question is
if I could insert write_byte function to the scheduler
queue in such a way to prevent this problem.
Thanks in advance
Dimitrios.
=====
------------------------------------------------------------
-Dhmhtrios Meidanis
-Degree in Mathematics, University of the Aegean.
-Master in Computer Architecture and Digital
Systems, University of Crete.
Greece.
------------------------------------------------------------
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Linux Kernel generic question (procedure queue)
2003-05-06 6:44 None Atall
2003-05-06 6:01 ` Der Herr Hofrat
@ 2003-05-06 7:20 ` Vladimir Gurevich
1 sibling, 0 replies; 6+ messages in thread
From: Vladimir Gurevich @ 2003-05-06 7:20 UTC (permalink / raw)
To: None Atall; +Cc: linuxppc-embedded
Hello Dimitrios,
There are a number of mechanisms in the Linux kernel
that allow you to schedule execution of some code at
a later time as well as to wait for something to
happen. Wait queues, tasklets, kernel timers are
the most important ones.
The problem is that to choose and to use them properly
you need to know how they work, how they differ from
each other and how they are supposed to be used (because
they can easily be misused and this usually leads to
disasters). It is definitely not possible to go over
it in an email, so I'd refer you to the excellent book
by Rubini and Corbet that discusses all these (and many
other) issues.
As for your question goes, there are two main mechanisms
you should look at:
-- wait queues are usually used in drivers to
return the control to the scheduler until the
HW operation is finished. Look for
interruptible_sleep_on() and wake_up_interruptible()
-- I don't know exactly how do you plan to use your GPIOs
to implement SPI, but if you plan to use interrupts
you might be better of by using the write_buff()
function to fill your driver's buffer, submit
the first byte to the device via write_byte() and then go
to sleep on a wait queue. Then use the interrupt handler
to drain the buffer and wake up the process after
you have finished sending data (you can also use kernel
timers to wake it up in case there was a timeout).
But my main advise will be to get yourself a copy of
"Linux Device Drivers" by Rubini and Corbet first.
Happy hacking,
Vladimir Gurevich
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Linux Kernel generic question (procedure queue)
@ 2003-05-06 12:40 Steven Rothweiler
2003-05-06 13:26 ` Gary Thomas
0 siblings, 1 reply; 6+ messages in thread
From: Steven Rothweiler @ 2003-05-06 12:40 UTC (permalink / raw)
To: linuxppc-embedded
>
> But my main advice will be to get yourself a copy of
> "Linux Device Drivers" by Rubini and Corbet first.
>
After purchasing the book on Vladmir's great advice, I realized
that I could download the PDF version of the entire book at
http://www.xml.com/ldd/chapter/book/bookindexpdf.html .
Is there any reason the PDF version of this book is (seemingly)
free? I don't feel bad about downloading it, since I've already
purchased the book, but I think it's not fair to the authors.
Unless, of course, they *want* to give it away...
--
STeve
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Linux Kernel generic question (procedure queue)
2003-05-06 12:40 Linux Kernel generic question (procedure queue) Steven Rothweiler
@ 2003-05-06 13:26 ` Gary Thomas
0 siblings, 0 replies; 6+ messages in thread
From: Gary Thomas @ 2003-05-06 13:26 UTC (permalink / raw)
To: Steven Rothweiler; +Cc: linuxppc embedded
On Tue, 2003-05-06 at 06:40, Steven Rothweiler wrote:
> >
> > But my main advice will be to get yourself a copy of
> > "Linux Device Drivers" by Rubini and Corbet first.
> >
>
> After purchasing the book on Vladmir's great advice, I realized
> that I could download the PDF version of the entire book at
> http://www.xml.com/ldd/chapter/book/bookindexpdf.html .
>
> Is there any reason the PDF version of this book is (seemingly)
> free? I don't feel bad about downloading it, since I've already
> purchased the book, but I think it's not fair to the authors.
>
> Unless, of course, they *want* to give it away...
Read page 'xvii':
Online Version and License
The authors have chosen to make this book freely available under
the GNU Free Documentation License, version 1.1.
--
Gary Thomas <gary@mlbassoc.com>
MLB Associates
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Linux Kernel generic question (procedure queue)
@ 2003-05-06 13:37 Steven Rothweiler
0 siblings, 0 replies; 6+ messages in thread
From: Steven Rothweiler @ 2003-05-06 13:37 UTC (permalink / raw)
To: linuxppc embedded
Thanks, Gary, I didn't know there was such a thing...
>
> Read page 'xvii':
> Online Version and License
> The authors have chosen to make this book freely available under
> the GNU Free Documentation License, version 1.1.
>
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2003-05-06 13:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-06 12:40 Linux Kernel generic question (procedure queue) Steven Rothweiler
2003-05-06 13:26 ` Gary Thomas
-- strict thread matches above, loose matches on Subject: below --
2003-05-06 13:37 Steven Rothweiler
2003-05-06 6:44 None Atall
2003-05-06 6:01 ` Der Herr Hofrat
2003-05-06 7:20 ` Vladimir Gurevich
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).