Skip to contentSkip to conversation

Found the cause of my 2.6.6-rc boot failures

DISCUSSION Art Haas 2 participants 4 messages Apr 30, 2004 – May 3, 2004

lore
Share & tools
lore

Art Haas

author
#0 lore raw

Hi.

The 1.69->1.70 changes in fs/dcache.c are the problem keeping my system from booting. This change introduced the bit of code where the global 'mempages' variable is reduced by calling nr_free_pages() and subtracting that result. By commenting out the change to on line 1634 the machine continues the boot sequence. Unfortunately I encounter a kernel trap after mounting the first drive in the machine, so I can't yet claim victory in getting a 2.6.6-rc kernel to work on the machine.

Art Haas

Signature · 4 lines
Man once surrendering his reason, has no remaining guard against absurdities
the most monstrous, and like a ship without rudder, is the sport of every wind.

-Thomas Jefferson to James Smith, 1822
#1 lore raw
Quoted 4 lines · Art Haas

The 1.69->1.70 changes in fs/dcache.c are the problem keeping my system from booting. This change introduced the bit of code where the global 'mempages' variable is reduced by calling nr_free_pages() and subtracting that result. By commenting out the change to on line 1634

Nice work, thanks. This patch should solve the problem. Please test.

=== arch/sparc/mm/init.c 1.27 vs edited ==--- 1.27/arch/sparc/mm/init.c Sun Mar 21 14:43:34 2004
+++ edited/arch/sparc/mm/init.c Sun May 2 22:42:14 2004
@@ -400,6 +400,7 @@
int codepages = 0;
int datapages = 0;
int initpages = 0;
+ int reservedpages = 0;
int i;

highmem_start_page = pfn_to_page(highstart_pfn);
@@ -434,12 +435,14 @@
max_mapnr = last_valid_pfn - pfn_base; high_memory = __va(max_low_pfn << PAGE_SHIFT);

- num_physpages = totalram_pages = free_all_bootmem();
+ totalram_pages = free_all_bootmem();

for (i = 0; sp_banks[i].num_bytes != 0; i++) {
unsigned long start_pfn = sp_banks[i].base_addr >> PAGE_SHIFT; unsigned long end_pfn = (sp_banks[i].base_addr + sp_banks[i].num_bytes) >> PAGE_SHIFT;

+ num_physpages += sp_banks[i].num_bytes >> PAGE_SHIFT;
+
if (end_pfn <= highstart_pfn)
continue;

@@ -458,13 +461,20 @@
initpages = (((unsigned long) &__init_end) - ((unsigned long) &__init_begin)); initpages = PAGE_ALIGN(initpages) >> PAGE_SHIFT;

- printk(KERN_INFO "Memory: %dk available (%dk kernel code, %dk data, %dk init, %ldk highmem) [%08lx,%08lx]\n",
- nr_free_pages() << (PAGE_SHIFT-10),
+ /* Ignore memory holes for the purpose of counting reserved pages */
+ for (i=0; i < max_low_pfn; i++)
+ if (test_bit(i >> (20 - PAGE_SHIFT), sparc_valid_addr_bitmap)
+ && PageReserved(pfn_to_page(i)))
+ reservedpages++;
+
+ printk(KERN_INFO "Memory: %luk/%luk available (%dk kernel code, %dk reserved, %dk data, %dk init, %ldk highmem)\n",
+ (unsigned long) nr_free_pages() << (PAGE_SHIFT-10),
+ num_physpages << (PAGE_SHIFT - 10),
codepages << (PAGE_SHIFT-10),
+ reservedpages << (PAGE_SHIFT - 10),
datapages << (PAGE_SHIFT-10),
initpages << (PAGE_SHIFT-10),

-	       totalhigh_pages << (PAGE_SHIFT-10),
-	       (unsigned long)PAGE_OFFSET, (last_valid_pfn << PAGE_SHIFT));
+	       totalhigh_pages << (PAGE_SHIFT-10));

}

void free_initmem (void)

Signature · 1 line
Keith M Wesolowski
author
#2 lore raw
In reply to Art Haas

Hi.

After applying the patch, and building and installing the kernel, I am happy to report my first successful boot of the 2.6.6-rc kernels! My kernel code is Linus's BK from yesterday afternoon/evening, so the version I'm running is really 2.6.6-rc3 + BK.

Here's a bit of dmesg output with the memory info ...

319MB HIGHMEM available.
On node 0 totalpages: 130399
DMA zone: 48656 pages, LIFO batch:11
Normal zone: 0 pages, LIFO batch:1
HighMem zone: 81743 pages, LIFO batch:16
Power off control detected.
Built 1 zonelists
Kernel command line: root=/dev/sda1 ro
PID hash table entries: 2048 (order 11: 16384 bytes)
Console: colour dummy device 80x25
Memory: 510644k/523580k available (1364k kernel code, 12312k reserved,

        344k data, 120k init, 326972k highmem)

Calibrating delay loop... 59.80 BogoMIPS
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes) Inode-cache hash table entries: 32768 (order: 5, 131072 bytes) Mount-cache hash table entries: 512 (order: 0, 4096 bytes)

I had been fiddling with a patch that set 'num_physpages' to the value of 'highend_pfn', but my patch had failed. I believe the value that my patch produced, and your patch produced, are identical - a printk() addition would confirm this. Still, the kernel I had built failed to boot, whereas the kernel with your patch is up and running. Yay!

Please send this patch to Linus so it can get into the official 2.6.6 release.

Art Haas

Signature · 4 lines
Man once surrendering his reason, has no remaining guard against absurdities
the most monstrous, and like a ship without rudder, is the sport of every wind.

-Thomas Jefferson to James Smith, 1822
#3 lore raw
In reply to Art Haas
Quoted 4 lines · Art Haas

After applying the patch, and building and installing the kernel, I am happy to report my first successful boot of the 2.6.6-rc kernels! My kernel code is Linus's BK from yesterday afternoon/evening, so the version I'm running is really 2.6.6-rc3 + BK.

Glad to hear it.

Quoted 7 lines

Memory: 510644k/523580k available (1364k kernel code, 12312k reserved,

        344k data, 120k init, 326972k highmem)

Calibrating delay loop... 59.80 BogoMIPS
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes) Inode-cache hash table entries: 32768 (order: 5, 131072 bytes) Mount-cache hash table entries: 512 (order: 0, 4096 bytes)

Quoted 5 lines

I had been fiddling with a patch that set 'num_physpages' to the value of 'highend_pfn', but my patch had failed. I believe the value that my patch produced, and your patch produced, are identical - a printk() addition would confirm this. Still, the kernel I had built failed to boot, whereas the kernel with your patch is up and running. Yay!

Blindly setting it to highend_pfn is correct only for systems with contiguous zero-based memory larger than 192MB. For sparse or small memory systems it would be wrong.

You can actually see what the value is by looking at the output, which is now like x86 - 510644k/523580k is nr_free_pages() << (PAGE_SHIFT -
10) and num_physpages << (PAGE_SHIFT - 10).

Quoted 2 lines

Please send this patch to Linus so it can get into the official 2.6.6 release.

I'll send it along.

Thanks for testing.

Signature · 1 line
Keith M Wesolowski