Variable-size user/kernel shared buffers

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

On a tangent from the 'Kernel-userspace shared mutex' thread..

I'm building a virtual network driver that consists of a user-space
daemon that does all the work, and a kernel module to interface with the
system; It makes use of an mmap()'d shared area to communicate network
packets and management info..

The shared area will be a large area of memory which will be used for
storing packets, a bit like sk_buffs; each buffer can be either held by
kernel, or held by daemon...Or not used.

I'm trying to work out a way to use variable-size buffers, because I'd
like to avoid relying on a max packet size, partly because of the space
wastage, and partly because of the dependancy on that value..

I'm considering writing a mini memory management system using pages of,
say, 1024 bytes, and keeping the free pages in a list.. When allocating,
we search through to find a contiguous area of the requested size, and
removes those pages from the free list..

Is there any system already implemented that does something like this?
I see that sk_buffs use lookaside caches, but that's not quite what I
need, because that's a fixed size.

I'd imagine that if there wasn't something already in place to do this,
I'd write a system that uses a list sorted by address, so that it
wouldn't be too hard to find contiguous areas.. The tough part would be
reinserting freed pages, because it involves a linear search..

Does anyone have any ideas?

Cheers =)

Mike


- --
Mike Tyson <mike@xxxxxxxxxxxxx>
M: (+61) 0407 754 124
W: http://tzidesign.com


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQFCsmD//eih+gEb7pQRAv2AAKDVLE+ABND6Xk+8YW7sIPyrV53ATgCgxpPO
HEMDUBGmk9j+82QBNIQtz4Q=
=t/63
-----END PGP SIGNATURE-----

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux