···909091919292/*9393- * Initialize the bootmem system and give it all the memory we have available.9393+ * Initialize the bootmem system and give it all low memory we have available.9494 */95959696void __init bootmem_init(void)···142142143143 /* Add all remaining memory pieces into the bootmem map */144144145145- for (i=0; i<sysmem.nr_banks; i++)146146- free_bootmem(sysmem.bank[i].start,147147- sysmem.bank[i].end - sysmem.bank[i].start);145145+ for (i = 0; i < sysmem.nr_banks; i++) {146146+ if (sysmem.bank[i].start >> PAGE_SHIFT < max_low_pfn) {147147+ unsigned long end = min(max_low_pfn << PAGE_SHIFT,148148+ sysmem.bank[i].end);149149+ free_bootmem(sysmem.bank[i].start,150150+ end - sysmem.bank[i].start);151151+ }152152+ }148153149154}150155