Re: newbie question: tcp/ip in kernel

From: Reto Baettig (baettig@scs.ch)
Date: Mon Aug 28 2000 - 16:41:12 EST


"Richard B. Johnson" wrote:
>
> Unix and Unix variants such as Linux have kernels that perform functions
> in behalf of tasks (processes) . The kernel, alone, does not have a
> process context so it can't do something for "itself".

I am sorry. I did not make myself clear enough:
It's a kernel-thread which is doing TCP/IP, not the "kernel itself". The
thread should be associated with the init process.

>
> To do any kind of communication requires a file-descriptor or socket
> that is associated with a process (task). It is essential that a fd
> be associated with some process. In fact, since the kernel performs
> functions on behalf of the current process, this association is
> established as "current" in the kernel. Look into "current" and see
> what an amazing object it is!
>
> Alone, there will be no "current". You would be stealing the context
> of some task that might not even continue to exist between two uses
> of your fd. You would also be using memory and other resources from
> some task that you will surely eventually destroy.
>
> It is possible to create a "kernel thread". This is a process that
> exists in the kernel but has all the characteristics of a task.
> `ps` will show kflushd, kupdate, kpiod, and kswapd. These are kernel
> threads. They each have their own pid and they each have their own
> context. In principle, such a task could perform TCP/IP.

...see previous explanation. Is that ok?

>
> > What is the proper way to make that thing SMP-Safe in 2.4?
>
> You gotta be kidding.

Sorry, I don't understand this answer. Please explain

        Reto
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Aug 31 2000 - 21:00:22 EST