public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Xavier Bru <xavier.bru@bull.net>
To: linux-ia64@vger.kernel.org
Subject: Missing code in bootmem.c for discontigmem
Date: Thu, 27 Nov 2003 15:42:12 +0000	[thread overview]
Message-ID: <marc-linux-ia64-106994770902664@msgid-missing> (raw)

Hello all,

Booting 2.6.0-test10 on Numa system, we fall in:
    Kernel panic: map_single: bounce buffer is not DMA'ble
due to alloc_bootmem_low_pages() returning a highmem address at sw IO TLB
initialization:
    Placing software IO TLB between 0xe0000030014e4000 - 0xe0000030016e4000
This was OK in test9 due to init_bootmem_core() sorting the pgdat_list.
Restoring the previous code, system boots OK (using the last scsi 
patches :-)
Herafter the patch:

diff --exclude-from /home2/xb/proc/diff.exclude -Nur 0t10/mm/bootmem.c 
linux-2.6.0-test10.old/mm/bootmem.c
--- 0t10/mm/bootmem.c    2003-11-24 02:31:28.000000000 +0100
+++ linux-2.6.0-test10.old/mm/bootmem.c    2003-11-27 15:19:53.000000000 
+0100
@@ -48,8 +48,24 @@
     bootmem_data_t *bdata = pgdat->bdata;
     unsigned long mapsize = ((end - start)+7)/8;
 
-    pgdat->pgdat_next = pgdat_list;
-    pgdat_list = pgdat;
+
+    /*
+     * sort pgdat_list so that the lowest one comes first,
+     * which makes alloc_bootmem_low_pages work as desired.
+     */
+    if (!pgdat_list || pgdat_list->node_start_pfn > 
pgdat->node_start_pfn) {
+        pgdat->pgdat_next = pgdat_list;
+        pgdat_list = pgdat;
+    } else {
+        pg_data_t *tmp = pgdat_list;
+        while (tmp->pgdat_next) {
+            if (tmp->pgdat_next->node_start_pfn > pgdat->node_start_pfn)
+                break;
+            tmp = tmp->pgdat_next;
+        }
+        pgdat->pgdat_next = tmp->pgdat_next;
+        tmp->pgdat_next = pgdat;
+    }
 
     mapsize = (mapsize + (sizeof(long) - 1UL)) & ~(sizeof(long) - 1UL);
     bdata->node_bootmem_map = phys_to_virt(mapstart << PAGE_SHIFT);

-- 

 Sincères salutations.
_____________________________________________________________________
 
Xavier BRU                 BULL ISD/R&D/INTEL office:     FREC B1-422
tel : +33 (0)4 76 29 77 45                    http://www-frec.bull.fr
fax : +33 (0)4 76 29 77 70                 mailto:Xavier.Bru@bull.net
addr: BULL, 1 rue de Provence, BP 208, 38432 Echirolles Cedex, FRANCE
_____________________________________________________________________



             reply	other threads:[~2003-11-27 15:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-27 15:42 Xavier Bru [this message]
2003-12-01 17:22 ` Missing code in bootmem.c for discontigmem Jesse Barnes
2003-12-01 19:25 ` Jesse Barnes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-ia64-106994770902664@msgid-missing \
    --to=xavier.bru@bull.net \
    --cc=linux-ia64@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox