[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compiling C++ kernel module + Makefile


Giuliano Pochini wrote:
> On Mon, 19 Jan 2004, Bart Samwel wrote:
>>But we're not talking about the base kernel here. We're not talking
>>about migrating the kernel to C++, or even modules that are part of the
>>Linux kernel source. We're talking about *independent modules*. The
>>kernel exports a module interface, and any binary driver that correctly
>>hooks into the interface of the running kernel (using the correct
>>calling conventions of the running kernel) and behaves properly (e.g.,
>>doesn't do stack unwinds over chunks of kernel functions etc.) can hook
>>into it and do useful work. If somebody has decided that it would be
>>worth it for his project to use C++ (without exceptions, rtti and the
>>whole shebang) then so be it, why should you care? It's just binary code
>>that hooks into the module interface, using the correct calling
>>conventions. It doesn't do dirty stuff -- no exceptions, no RTTI,
>>etcetera. It compiles into plain, module-interface conforming assembler,
>>that can be compiled with -- you guessed it -- 'as', the AT&T syntax
>>assembler. Yes, they're taking a risk. Their risk is that C++ can't
>>import the kernel headers, or that C++ might someday need runtime
>>support that cannot be ported into the kernel.

[...]
> Maybe the right solution is writing a module that provides a fast data
> path between the kernel and the userspace router.

Hmmm, I think that would be problematic. The throughput would probably 
be relatively OK (it's perfectly feasible to stash a load of packets 
into an mmapped area with zero copies and to have them all routed in 
userspace) but the latency is a different story. A router should be able 
to pass on packets with the lowest possible latency. I don't think it's 
feasible to schedule a userspace router process for every packet that 
comes in (they can currently do 435,000 packets per second on a P3-700), 
so that would have to be done in bulk, and that's a killer for your latency.

AFAICS the right solution would be to do it in the kernel and not to use 
C++ for it. It's a bit late for that now though. :)

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


この情報があなたの探していたものかどうか選択してください。
yes/まさにこれだ!   no/違うなぁ   part/一部見つかった   try/これで試してみる

あなたが探していた情報はどのようなことか、ご自由に記入下さい。特に「まさにこれだ!」と言う場合は記入をお願いします。
例:「複数のマシンからCATV経由でipmasqueradeを利用してWebを参照したい場合の設定について」
References: