Re: Crash while mapping memory in pagetable_init() (Was: Re: .config)

2007-04-13 Thread Chris Wright
* Jeremy Fitzhardinge ([EMAIL PROTECTED]) wrote: > Subject: i386: map enough initial memory to create lowmem mappings > > head.S creates the very initial pagetable for the kernel. This just > maps enough space for the kernel itself, and an allocation bitmap. > The amount of mapped memory is

Re: Crash while mapping memory in pagetable_init() (Was: Re: .config)

2007-04-13 Thread H. Peter Anvin
Jeremy Fitzhardinge wrote: H. Peter Anvin wrote: Even with PSE? Perhaps not. However, the main reason I wanted it done that way is to avoid cargo cult programming; this makes it much clearer where the numbers actually come from. Well, how about this then? I like. Acked-by: H. Peter

Re: Crash while mapping memory in pagetable_init() (Was: Re: .config)

2007-04-13 Thread Zachary Amsden
H. Peter Anvin wrote: #ifdef CONFIG_X86_PAE PAGE_TABLE_SIZE = (2048+4)*4096 #else PAGE_TABLE_SIZE = (1024+1)*4096 #endif BOOTMEM_SIZE = 128*1024 /* ACPI and SMP trampoline allocate bootmem pages before paging_init */ #ifdef CONFIG_SMP SMP_BOOTMEM_EARLY= 1 #else SMP_BOOTMEM_EARLY= 0 #endif

Re: Crash while mapping memory in pagetable_init() (Was: Re: .config)

2007-04-13 Thread Jeremy Fitzhardinge
H. Peter Anvin wrote: > Even with PSE? Perhaps not. > However, the main reason I wanted it done that way is to avoid cargo > cult programming; this makes it much clearer where the numbers > actually come from. Well, how about this then? Subject: i386: map enough initial memory to create lowmem

Re: Crash while mapping memory in pagetable_init() (Was: Re: .config)

2007-04-13 Thread H. Peter Anvin
Jeremy Fitzhardinge wrote: H. Peter Anvin wrote: I suggest, for clarity and to minimize bloat: I think it would save a page, at most. But OK. (Also, if you're running !PAE, these pages will actually become part of the init_mm pagetable, so there's no memory wastage at all.) Even with PSE?

Re: Crash while mapping memory in pagetable_init() (Was: Re: .config)

2007-04-13 Thread H. Peter Anvin
H. Peter Anvin wrote: Jeremy Fitzhardinge wrote: H. Peter Anvin wrote: Really (pae ? 2M : 1M), in other words, plus the 128K for bootmem. Note that this is creating page tables for, not erasing. To map 2M, we will only use 2K of additional memory (meaning there is 50% chance we end up using

Re: Crash while mapping memory in pagetable_init() (Was: Re: .config)

2007-04-13 Thread Jeremy Fitzhardinge
H. Peter Anvin wrote: > I suggest, for clarity and to minimize bloat: I think it would save a page, at most. But OK. (Also, if you're running !PAE, these pages will actually become part of the init_mm pagetable, so there's no memory wastage at all.) > #ifdef CONFIG_X86_PAE > # define

Re: Crash while mapping memory in pagetable_init() (Was: Re: .config)

2007-04-13 Thread H. Peter Anvin
Jeremy Fitzhardinge wrote: H. Peter Anvin wrote: Really (pae ? 2M : 1M), in other words, plus the 128K for bootmem. Note that this is creating page tables for, not erasing. To map 2M, we will only use 2K of additional memory (meaning there is 50% chance we end up using an additional 4K page.)

Re: Crash while mapping memory in pagetable_init() (Was: Re: .config)

2007-04-13 Thread Jeremy Fitzhardinge
H. Peter Anvin wrote: > Really (pae ? 2M : 1M), in other words, plus the 128K for bootmem. > Note that this is creating page tables for, not erasing. To map 2M, > we will only use 2K of additional memory (meaning there is 50% chance > we end up using an additional 4K page.) > > So the solution

Re: Crash while mapping memory in pagetable_init() (Was: Re: .config)

2007-04-13 Thread H. Peter Anvin
Zachary Amsden wrote: Jeremy Fitzhardinge wrote: It seems to me that the problem is simply that it runs out of space. head.S maps 8Mbytes of memory. 8 MB was a long time ago. head.S maps the kernel size plus INIT_MAP_BEYOND_END, which is currently set to 128K. The kernel takes ~6.8M of

Re: Crash while mapping memory in pagetable_init() (Was: Re: .config)

2007-04-13 Thread Jeremy Fitzhardinge
Zachary Amsden wrote: > Note you can always run out of space; to ensure safety, the init code > needs to not use a fixed mapping size, it needs to map > end_kernel_address + pae ? 1808k : 896k, assuming 128M vmalloc hole. > This could cause problems like running into initrd, however, so might >

Re: Crash while mapping memory in pagetable_init() (Was: Re: .config)

2007-04-13 Thread Zachary Amsden
Jeremy Fitzhardinge wrote: It seems to me that the problem is simply that it runs out of space. head.S maps 8Mbytes of memory. The kernel takes ~6.8M of that, and there simply isn't enough remaining space to fit the pagetables to map all memory into the kernel address space. Here's my dump of

Re: Crash while mapping memory in pagetable_init() (Was: Re: .config)

2007-04-13 Thread Zachary Amsden
Jeremy Fitzhardinge wrote: It seems to me that the problem is simply that it runs out of space. head.S maps 8Mbytes of memory. The kernel takes ~6.8M of that, and there simply isn't enough remaining space to fit the pagetables to map all memory into the kernel address space. Here's my dump of

Re: Crash while mapping memory in pagetable_init() (Was: Re: .config)

2007-04-13 Thread Jeremy Fitzhardinge
Zachary Amsden wrote: Note you can always run out of space; to ensure safety, the init code needs to not use a fixed mapping size, it needs to map end_kernel_address + pae ? 1808k : 896k, assuming 128M vmalloc hole. This could cause problems like running into initrd, however, so might

Re: Crash while mapping memory in pagetable_init() (Was: Re: .config)

2007-04-13 Thread H. Peter Anvin
Zachary Amsden wrote: Jeremy Fitzhardinge wrote: It seems to me that the problem is simply that it runs out of space. head.S maps 8Mbytes of memory. 8 MB was a long time ago. head.S maps the kernel size plus INIT_MAP_BEYOND_END, which is currently set to 128K. The kernel takes ~6.8M of

Re: Crash while mapping memory in pagetable_init() (Was: Re: .config)

2007-04-13 Thread Jeremy Fitzhardinge
H. Peter Anvin wrote: Really (pae ? 2M : 1M), in other words, plus the 128K for bootmem. Note that this is creating page tables for, not erasing. To map 2M, we will only use 2K of additional memory (meaning there is 50% chance we end up using an additional 4K page.) So the solution is

Re: Crash while mapping memory in pagetable_init() (Was: Re: .config)

2007-04-13 Thread H. Peter Anvin
Jeremy Fitzhardinge wrote: H. Peter Anvin wrote: Really (pae ? 2M : 1M), in other words, plus the 128K for bootmem. Note that this is creating page tables for, not erasing. To map 2M, we will only use 2K of additional memory (meaning there is 50% chance we end up using an additional 4K page.)

Re: Crash while mapping memory in pagetable_init() (Was: Re: .config)

2007-04-13 Thread Jeremy Fitzhardinge
H. Peter Anvin wrote: I suggest, for clarity and to minimize bloat: I think it would save a page, at most. But OK. (Also, if you're running !PAE, these pages will actually become part of the init_mm pagetable, so there's no memory wastage at all.) #ifdef CONFIG_X86_PAE # define

Re: Crash while mapping memory in pagetable_init() (Was: Re: .config)

2007-04-13 Thread H. Peter Anvin
H. Peter Anvin wrote: Jeremy Fitzhardinge wrote: H. Peter Anvin wrote: Really (pae ? 2M : 1M), in other words, plus the 128K for bootmem. Note that this is creating page tables for, not erasing. To map 2M, we will only use 2K of additional memory (meaning there is 50% chance we end up using

Re: Crash while mapping memory in pagetable_init() (Was: Re: .config)

2007-04-13 Thread H. Peter Anvin
Jeremy Fitzhardinge wrote: H. Peter Anvin wrote: I suggest, for clarity and to minimize bloat: I think it would save a page, at most. But OK. (Also, if you're running !PAE, these pages will actually become part of the init_mm pagetable, so there's no memory wastage at all.) Even with PSE?

Re: Crash while mapping memory in pagetable_init() (Was: Re: .config)

2007-04-13 Thread Jeremy Fitzhardinge
H. Peter Anvin wrote: Even with PSE? Perhaps not. However, the main reason I wanted it done that way is to avoid cargo cult programming; this makes it much clearer where the numbers actually come from. Well, how about this then? Subject: i386: map enough initial memory to create lowmem

Re: Crash while mapping memory in pagetable_init() (Was: Re: .config)

2007-04-13 Thread Zachary Amsden
H. Peter Anvin wrote: #ifdef CONFIG_X86_PAE PAGE_TABLE_SIZE = (2048+4)*4096 #else PAGE_TABLE_SIZE = (1024+1)*4096 #endif BOOTMEM_SIZE = 128*1024 /* ACPI and SMP trampoline allocate bootmem pages before paging_init */ #ifdef CONFIG_SMP SMP_BOOTMEM_EARLY= 1 #else SMP_BOOTMEM_EARLY= 0 #endif

Re: Crash while mapping memory in pagetable_init() (Was: Re: .config)

2007-04-13 Thread H. Peter Anvin
Jeremy Fitzhardinge wrote: H. Peter Anvin wrote: Even with PSE? Perhaps not. However, the main reason I wanted it done that way is to avoid cargo cult programming; this makes it much clearer where the numbers actually come from. Well, how about this then? I like. Acked-by: H. Peter

Re: Crash while mapping memory in pagetable_init() (Was: Re: .config)

2007-04-13 Thread Chris Wright
* Jeremy Fitzhardinge ([EMAIL PROTECTED]) wrote: Subject: i386: map enough initial memory to create lowmem mappings head.S creates the very initial pagetable for the kernel. This just maps enough space for the kernel itself, and an allocation bitmap. The amount of mapped memory is rounded