From: Stuart M. <stu...@st...> - 2002-06-10 16:32:46
|
Hi Ben Highmem is used on systems which have more physical memory than can be mapped into kernel space, usually more than 2G or 3G. In this case the bottom part of phyical memory is permantly mapped into kernel space (lowmem) and the rest is mapped as required (highmem) - usually when copying data to or from kernel space. To make this work requires code to be written in the machine specific parts of the kernel, something nobody has bothered to do for the shmedia kernel. For every page in the system, there is a struct page. This is around 48 bytes, so this ammounts to quite a high percentage of your memory simply being used to keep track of memory, so it is worthwhile trying to make this struct as small as possible. For lowmem it is a simple calculation to convert the address of a struct page into the virtual address for that page. It looks like sometime between 2.4.17 and 2.4.19, a change was made to only use the 'virtual' member of struct page if required - usually only if highmem is in use. The best way to fix this would be to change your code to use the page_address() macro to get at this data. If the virtual field is in use, it will use it, otherwise it will do the calculation. Hope this helps Stuart On Mon, 10 Jun 2002 15:34:15 +0100 ben...@su... wrote: > Hello! > > It seems that for some ports of the Linux kernel RAM is mapped > completely into the kernel's address space while on machines with > "highmem" some memory is mapped into the kernel virtual memory > dynamically. The use of "highmem" seems to be controlled through the > configuration has define: > > CONFIG_HIGHMEM > > and defining this has the important consequence of adding the following > field to the definition of "struct page" in mm.h: > > void *virtual; /* Kernel virtual address (NULL if not kmapped, ie. > highmem) */ > > If we look in ./arch/shmedia/config.in we see that CONFIG_HIGHMEM is > not defined and thus the virtual field is never defined. This seems to > imply that no memory can be mapped into the kernel dynamically! Can > anyone explain this in more detail as the problem is I'm porting some > code to SHMedia Linux that makes reference to this field. > > thanks, > > ben. > -- Stuart Menefy stu...@st... STMicroelectronics Ltd ST Intranet: mo.bri.st.com Bristol, UK Rest of the World: www.linuxsh.st.com |