Re: Kernel newbie questions

From: Nick Landsberg (hukolau_at_NOSPAM.att.net)
Date: 03/06/04


Date: Sat, 06 Mar 2004 01:28:31 GMT


Jeroen Geilman wrote:

[SNIP]

>
>> Some early implementations of TCP/IP ran as user processes.
>> They ran so slowly that they were moved into the kernel because
>> of that.
>
>
> Ah - this would be the reason the entire TCP/IP stack is in the kernel,
> then ?
> And also probably why the Windows TCP/IP "stacks" (I use the word
> loosely) suck so badly...
>
>

In a word, yes!

In many words ...

You do not want to have time-critical functions, such
as millisecond timeout values, relegated to user space
because the timing is NOT guaranteed due to the
vaguaries of the user-proc scheduler. (It IS deterministic,
so they say, but the normal human brain cannot comprehend
the determinism.)

In a Unix/Linux world, it appears to be non-deterministic, and
there are packets that may go unprocessed because a user level
TCP "stack" (and it ain't, and I'm glad you used the term
loosely), may not get scheduled in time to service the request.
Once you move it into the kernel, you can schedule the servicing
to be at the next clock tick.

In a Windows world, I have no definite idea of what happens, just
observations. For example, when you are using "Outlook" on a dial
up to access your email, you are effectively locked out from
doing anyting else on your machine while outlook is running,
even over a 56KB connection. One may presume that outlook
is setting it's priority such that other processes, other than
the window manager are effectivly locked out. My belief
is that NT (and 2000) have a fixed priority scheduler, and my
observations are consistent with a process being able
to increase its own priority at the expense of other processes.

Yes ... it sucks.

Nick

-- 
Ñ
"It is impossible to make anything foolproof because fools are so 
ingenious" - A. Bloch


Relevant Pages

  • Re: SCHED_FIFO and SCHED_RR broken by cfs
    ... SCHED_FIFO realtime scheduler. ... In my opinion a high priority real time user process with SCHED_FIFO ... should be only interrupted by the kernel or a process with an higher ...
    (Linux-Kernel)
  • Re: Xterm Hangs - Possible scheduler defect?
    ... >> perogative to don steel toed shoes(set important kernel threads to a higher ... >> priority) before pulling the trigger. ... I specifically directed the scheduler to run my thread at a higher ... >higher priority than the kernel I would have written something in kernel ...
    (Linux-Kernel)
  • Re: help needed pls. scheduler(kernel 2.6) + hyperthreaded related questions?
    ... I saw frm the kernel docs tht realtime tasks hav priority 0 to 99. ... is there any way I can tell the scheduler (assuming I make the ...
    (Linux-Kernel)
  • SCHED_FIFO and SCHED_RR broken by cfs
    ... SCHED_FIFO realtime scheduler. ... In my opinion a high priority real time user process with SCHED_FIFO ... should be only interrupted by the kernel or a process with an higher ... static inline void getCPUfreq ...
    (Linux-Kernel)
  • Re: RFC for a new Scheduling policy/class in the Linux-kernel
    ... B is holding a lock. ... A grants its priority B until B releases the lock. ... We want to charge B's critical section to B, ... scheduler computes how much time A has used recently, ...
    (Linux-Kernel)