Timers @%$#&
Jonathan S. Shapiro
jsshapiro@earthlink.net
Fri, 6 Feb 1998 13:43:38 -0500
Instead of the mechanism you came up with, why wouldn't this work:
2. A timer domain that runs with the same address space as the TCP/IP
domain and executes:
while (true) {
sleep();
turn off meter of TCP/IP domain;
if (mutex_bit)
run_timer_code_when_done = true;
else {
run timer code;
}
turn on meter of TCP/IP domain;
}
Your solution is better than mine, because it removes the exception
attendent on IP domain wakeup during the timer's execution. I shall
give it real thought, and possibly try to implement it this way. The
concern is that the IP timer is a 250ms timer, and the overhead on
this strategy is higher than it looks initially on the Pentium.
It may in the end be moot, as measurement suggests that the network
driver *must* perform data demultiplexing at interrupt level on a 100
mbit ethernet. Copying this data across a privilege boundary is slow,
and we have yet to arrive at a clean memory allocation mechanism for
the buffers that would readily allow the buffers to be shared between
IP and kernel.
There are actually two problems:
DMA is physical; the buffers very much want to be contiguous.
EROS currently has no *clean* mechanism for locking a buffer in
memory.
I may resolve this for now through the use of physical page keys, and
let the driver allocate the buffer space, but I am somewhat reluctant
to embed the policy there. I may in spite of this do so as a
temporary measure.
shap