lkml.org 
[lkml]   [2006]   [Jun]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Packing data in kernel memory
On Tue, 13 Jun 2006 22:18:55 +0200 (MEST) Jan Engelhardt wrote:

>
> >Subject: Packing data in kernel memory
> >
>
> Can't you just use mlock(), if you want to keep it in RAM?
>
> Or do you need it in kernel memory, because you need it in the lowmem area?
> Or for interaction with other kernel code?
>
> >Is there a way to pack and store arbitrary data in the kernel, or do I
> >need to roll my own?

Sounds a bit like a slab cache to me.

> Write a device driver, kmalloc some buffer, and copy data via a write
> function from userspace to that buffer. Should be trivial.
>
> >1 excess pages, 4 units wasted memory.
>
> Of course, kmalloc only works up to some boundary AFIACS.

128 KB on some arches. More on a few IIRC.

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

\
 
 \ /
  Last update: 2006-06-13 22:32    [W:0.041 / U:6.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site