Re: A hole in kernel space!

Richard B. Johnson (root@chaos.analogic.com)
Wed, 6 Nov 2002 09:07:34 -0500 (EST)


On Wed, 6 Nov 2002, Marc A. Volovic wrote:

> Quoth Pannaga Bhushan:
>
> > Hi all,
> > I am looking for a setup where I need to have a certain amount
> > of data always available to the kernel. The size of data I am looking at
> > is abt
> > 40MB(preferably, but I will settle for 20MB too) . So the normal kmalloc
>
> I wrote a driver which steals a certain amount of memory from the kernel
> and makes it available to userspace (somewhat like the rd driver).
> If you want - I can send it to you.
>
> It exports a small device hierarchy which can be read, written and
> mmap'ed. The memory is contiguous. Not VERY elegant, but works quite
> well.
>
> The driver steals a certain amount of memory from the kernel at boot
> time, a-la the mem= parameter. I have used "holes" of up to 1GB in size.
>
>
> Marc

You know, I hope, that you can kmalloc(GFP_KERNEL) something in
init_module() and it will always be resident in the kernel until
you kfree() it in cleanup_module(). You do not have to
allocate/deallocate every time your module does something.

If you need a physical location, mmap() and ioremap() take care
of that. With these capabilities, I don't think you need "holes"
even if you are trying to map-out bad RAM. I think you need to
re-think your requirements.

Cheers,
Dick Johnson
Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips).
Bush : The Fourth Reich of America

-
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/