[plug] Scheduling Problems

Brad Campbell brad at seme.com.au
Wed May 17 16:55:36 WST 2000


I know that this is a LINUX users group, and as such, questions
about LINUX are usually shunned or skirted around.. ;p) BUT..

I have written a program that Polls an RS485 Network from
a couple of serial ports.
I understood that when a process blocks on a syscall, the scheduler
selects the next available runnable process.

so I'm transmitting some data to a file handle (ttyS3) and then
using a select() on that handle to notify me when I have data 
available.

I would have thought that if this was the only runnable process
on the system, after I recieved data, and looped back to the
start to do it again, I would be going about as fast as is
possible in a tight loop.

Lets say I'm polling 7 Units, on a standard kernel, I can poll
these 13 times a second, which is 91 loops a second.

Not very fast at all.
If I modify include/asm/param.h and take HZ from 100 to 300
I poll this lot 40 times a second.
or 280 loops per second.

Now, I understand by doing this, what I'm doing is breaking
the scheduler's time period into smaller pieces, thus each
task has a smaller run time per cycle.

What I don't understand is why this should speed things up
as I block the process anyway at the point where it waits 
for a response. Thus I should be forcing a reschedule long
before the scheduler interrupts the process.

The only thing I can think of, is I'm waiting on the bottom 
half interrupt handlers to run to distibute the recieved data,
and this gets sped up with a finer HZ grain.

FYI I'm transmitting 4 Bytes and recieving 2 Bytes at 38400
Which equates to 2ms total comms time.


-- 
Brad....
"The ultimate result is that some innovations that would
truly benefit consumers never occur for the sole reason
that they do not conincide with Microsoft's self-interest"
- Judge Thomas Penfield Jackson
         /"\
         \ /     ASCII RIBBON CAMPAIGN
          X      AGAINST HTML MAIL
         / \



More information about the plug mailing list