Subject: Re: Request for comments: sharing memory between user/kernel space
To: Allen Briggs <briggs@netbsd.org>
From: Zeljko Vrba <zvrba@globalnet.hr>
List: tech-kern
Date: 03/21/2007 17:18:55
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Allen Briggs <briggs@netbsd.org> writes:

>
> Sort of.  The main problem I can think of is that for this to work, I
> think you'd have to have at least essentially all mbufs in memory that
> is accessible from both the kernel and user space.  So your process
> gets to see all network traffic.  Is that OK with you?
>
Yes, that's OK.  Also, only 64-bits architectures where kernel and apps live
in the same address space are of interest to me (eg. x86-64).

>
> I think just the address space differences.  Translation, mapping, and
> hand-off.  It would be really easy, I think, for the user application
> to crash or at least starve the kernel.
>
The "crash" part is obvious, but what do you mean with the starvation part?
64-bit architecture has large enough address space so that the shared area is
mapped at identical addresses in the kernel and user-space.

Wouldn't it be possible to allocate mbufs in different "pool" than the network
data? The network packet would be received into the shared memory, and
mbufs/bookkeeping would get allocated in a kernel-private region (as is now),
so the application wouldn't be able to corrupt them.

Best regards,
  Zeljko.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)

iD8DBQFGAVryUIHQih3H6ZQRAxmuAKCwzNOYDwp2zSsGvOhVK2AgXonb9QCeLpST
FCR+CzeM6CJ8+Uam6zQnP0w=
=LGTm
-----END PGP SIGNATURE-----