Can I change the kernel memory spliting in linux-2.4.25 + ?
Subsystems (3)
Hello
Can I change the kernel memory spliting in linux-2.4.25 or onwards ??? Actually I want to change the kernel ZONE_NORMAL to 2GB from 1GB !!!!
How can i do this ??? I won't be able to see any
option in kernel configuration ...........
I tried to change the PAGE_OFFSET from 3G to 2G but got compilation error ..............
What I hav to do ???
Thanks
Fawad
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 3 lines · Fawad Lateef
Can I change the kernel memory spliting in linux-2.4.25 or onwards ??? Actually I want to change the kernel
ZONE_NORMALto 2GB from 1GB !!!!
Why do you want to do that?
Jon.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 3 lines · Fawad Lateef
Can I change the kernel memory spliting in linux-2.4.25 or onwards ??? Actually I want to change the kernel
ZONE_NORMALto 2GB from 1GB !!!!
sure you can :p
Quoted 2 lines
How can i do this ??? I won't be able to see any option in kernel configuration ...........
because 2.4 does not have such options nor you wrote some in there ;)
Quoted 3 lines
I tried to change the
PAGE_OFFSETfrom 3G to 2G but got compilation error ..............
What I hav to do ???
you may give attached patch a try.
Signature · 1 line
ciao, Marc
Documentation/Configure.help +34 -0
@@ -406,6 +406,40 @@ CONFIG_HIGHMEM64G Select this if you have a 32-bit processor and more than 4 gigabytes of physical RAM. +User address space size +CONFIG_05GB + If you have 4 Gigabytes of physical memory or less, you can change + where the kernel maps high memory. + + Typically there will 128 megabytes less "user memory" mapped + than the number in the configuration option. Saying that + another way, "high memory" will usually start 128 megabytes + lower than the configuration option. + + Selecting "05GB" results in a "3.5GB/0.5GB" kernel/user split. + On a system with 1 gigabyte of physical memory, you may get 384 + megabytes of "user memory" and 640 megabytes of "high memory" + with this selection. + + Selecting "1GB" results in a "3GB/1GB" kernel/user split. + On a system with 1 gigabyte of memory, you may get 896 MB of + "user memory" and 128 megabytes of "high memory" with this + selection. This is the usual setting. + + Selecting "2GB" results in a "2GB/2GB" kernel/user split. + On a system with less than 1.75 gigabytes of physical memory, + this option will make it so no memory is mapped as "high". + + Selecting "3GB" results in a "1GB/3GB" kernel/user split. + + Select "1GB" otherwise Win4Lin and valgrind won't work! + + Select "Real-1GB" to allocate even the last 128MB of RAM which + are normally mapped as high, but with this option mapped as low + without the need for enabling high memory support. + + If unsure, say "1GB". + HIGHMEM I/O support CONFIG_HIGHIO If you want to be able to do I/O to high memory pages, say Y.
Rules.make +17 -0
@@ -215,6 +215,7 @@ MODINCL = $(TOPDIR)/include/linux/module # # Added the SMP separator to stop module accidents between uniprocessor # and SMP Intel boxes - AC - from bits by Michael Chastain +# Added separator for different PAGE_OFFSET memory models - Ingo. # ifdef CONFIG_SMP
@@ -223,6 +224,22 @@ else genksyms_smp_prefix := endif +ifdef CONFIG_2GB +ifdef CONFIG_SMP + genksyms_smp_prefix := -p smp_2gig_ +else + genksyms_smp_prefix := -p 2gig_ +endif +endif + +ifdef CONFIG_3GB +ifdef CONFIG_SMP + genksyms_smp_prefix := -p smp_3gig_ +else + genksyms_smp_prefix := -p 3gig_ +endif +endif + $(MODINCL)/%.ver: %.c @if [ ! -r $(MODINCL)/$*.stamp -o $(MODINCL)/$*.stamp -ot $< ]; then \ echo '$(CC) $(CFLAGS) $(EXTRA_CFLAGS_nostdinc) -E -D__GENKSYMS__ $<'; \
arch/i386/Makefile +4 -0
@@ -114,6 +114,9 @@ arch/i386/mm: dummy MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot +arch/i386/vmlinux.lds: arch/i386/vmlinux.lds.S FORCE + $(CPP) -C -P -I$(HPATH) -imacros $(HPATH)/asm-i386/page_offset.h -Ui386 arch/i386/vmlinux.lds.S >arch/i386/vmlinux.lds + vmlinux: arch/i386/vmlinux.lds FORCE: ;
@@ -150,6 +153,7 @@ archclean: @$(MAKEBOOT) clean archmrproper: + rm -f arch/i386/vmlinux.lds archdep: @$(MAKEBOOT) dep
arch/i386/config.in +12 -0
@@ -216,6 +216,18 @@ else fi if [ "$CONFIG_HIGHMEM64G" = "y" ]; then define_bool CONFIG_X86_PAE y + choice 'User address space size' \ + "3GB CONFIG_1GB \ + 2GB CONFIG_2GB \ + Real-1GB CONFIG_1GB_REAL \ + 1GB CONFIG_3GB" 3GB +else + choice 'User address space size' \ + "3GB CONFIG_1GB \ + 2GB CONFIG_2GB \ + 1GB CONFIG_3GB \ + Real-1GB CONFIG_1GB_REAL \ + 3.5GB CONFIG_05GB" 3GB fi if [ "$CONFIG_HIGHMEM" = "y" ]; then
arch/i386/vmlinux.lds +0 -82
82 lines not on this page · raw message
arch/i386/vmlinux.lds.S +82 -0
82 lines not on this page · raw message
include/asm-i386/page.h +3 -1
@@ -78,7 +78,9 @@ typedef struct { unsigned long pgprot; }* and CONFIG_HIGHMEM64G options in the kernel configuration. */ -#define __PAGE_OFFSET (0xC0000000) +#include <asm/page_offset.h> + +#define __PAGE_OFFSET (PAGE_OFFSET_RAW)/* * This much address space is reserved for vmalloc() and iomap()
include/asm-i386/page_offset.h +12 -0
@@ -0,0 +1,12 @@ +#include <linux/config.h> +#ifdef CONFIG_05GB +# define PAGE_OFFSET_RAW 0xE0000000 +#elif defined(CONFIG_1GB ) +# define PAGE_OFFSET_RAW 0xC0000000 +#elif defined(CONFIG_1GB_REAL ) +# define PAGE_OFFSET_RAW 0xB0000000 +#elif defined(CONFIG_2GB ) +# define PAGE_OFFSET_RAW 0x80000000 +#elif defined(CONFIG_3GB ) +# define PAGE_OFFSET_RAW 0x40000000 +#endif
include/asm-i386/processor.h +4 -0
@@ -264,7 +264,11 @@ extern unsigned int mca_pentium_flag;/* This decides where the kernel will search for a free chunk of vm * space during mmap's. */ +#ifndef CONFIG_05GB #define TASK_UNMAPPED_BASE (TASK_SIZE / 3) +#else +#define TASK_UNMAPPED_BASE (TASK_SIZE / 16) +#endif /* * Size of io_bitmap in longwords: 32 is ports 0-0x3ff.
mm/memory.c +18 -5
@@ -108,8 +108,7 @@ static inline void free_one_pmd(pmd_t *static inline void free_one_pgd (pgd_t * dir) { -int j; -pmd_t * pmd; +pmd_t * pmd, * md, * emd;if (pgd_none (*dir))return ;
@@ -120,9 +119,23 @@ static inline void free_one_pgd(pgd_t * } pmd =pmd_offset (dir,0 );pgd_clear (dir); -for (j =0 ; j <PTRS_PER_PMD ; j++) { -prefetchw (pmd+j+(PREFETCH_STRIDE /16 )); -free_one_pmd (pmd+j); + +/* +* Beware if changing the loop below. It once used int j, +* for (j = 0; j < PTRS_PER_PMD; j++) +* free_one_pmd(pmd+j); +* but some older i386 compilers (e.g. egcs-2.91.66, gcc-2.95.3) +* terminated the loop with a _signed_ address comparison +* using "jle", when configured for HIGHMEM64GB (X86_PAE). +* If also configured for 3GB of kernel virtual address space, +* if page at physical 0x3ffff000 virtual 0x7ffff000 is used as +* a pmd, when that mm exits the loop goes on to free "entries" +* found at 0x80000000 onwards. The loop below compiles instead +* to be terminated by unsigned address comparison using "jb". +*/ +for (md = pmd, emd = pmd +PTRS_PER_PMD ; md < emd; md++) { +prefetchw (md+(PREFETCH_STRIDE /16 )); +free_one_pmd (md); }pmd_free (pmd); }