Re: [kbuild-devel] A hole in kernel space!

2002-11-06 Thread Peter Samuelson

Note: this question really belongs on [EMAIL PROTECTED].

[Pannaga Bhushan]
 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 will not help me. So what I did was, I created a hole
 in kernel space by putting the following line in vmlinux.lds

 ALIGN(4096);
  __hole_start = .;
 . = . + 0xmy_size;
  __hole_end = .;

I assume you also tried the old-fashioned C method:

  #include asm/page.h
  static char __hole_start[0xmy_size] __attribute__((__aligned__(PAGE_SIZE)));

Did that not work either?

 1.   Is there any other way I can get to keep 40MB(or even 20MB) of
 contiguous kernel memory space ?

There used to be a patch out there called `bigphysarea' - look around,
perhaps someone is still maintaining it.  It should do what you want.

 2.Abt the 17MB hole, I am able to use after the   _end = .;
  is this 17MB really there in kernel image?('cos it isn't in
 any segment and also it appears after _end).

I doubt it is accessible, but that is really uninformed speculation on
my part.

 (basically, i want by data in kernel space always available to kernel
 without having to bother abt swapping the pages back)

User space could allocate this space and then call mlockall().  That
does not guarantee *physically* contiguous space, though, and is only
accessible within to the address space of that one process.

Peter


---
This sf.net email is sponsored by: See the NEW Palm 
Tungsten T handheld. Power  Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
___
kbuild-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/kbuild-devel



[kbuild-devel] A hole in kernel space!

2002-11-05 Thread 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 will not help me. So what I did was,
I created a hole in kernel space by putting the following line in vmlinux.lds
 ALIGN(4096);
__hole_start = .;
 . = . + 0xmy_size;
__hole_end = .;
First, I put these lines in code segment and found that 'my_size'
cannot go beyond 0x50(5MB) . Any larger value , the kernel image refuses
to boot up. I found the same problem with these lines being in data segment
or in the bss segment.
But putting these line after
_end = .;
line in vmlinux.lds, I am able to give 0x170(17MB) to my_size and
still boot with that kernel image.
My questions are :
1. Is there any other way I can get to keep 40MB(or even
20MB) of contiguous kernel memory space ?
2. Abt the 17MB hole, I am able to use after the
_end = .;  is this 17MB really
there in kernel image?('cos it isn't in any segment and also it appears
after _end).
 if yes, are the pages corresponding
to this region swappable or is it that since this hole appears in kernel
image, it is locked to a physical space and this is never swapped. (basically,
i want by data in kernel space always available to kernel without having
to bother abt swapping the pages back)
Thanx in advance,
Pannaga Bhushan