From f02e8e8122a00fe079a942f8de5f35279451b707 Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Mon, 1 Sep 2003 07:06:57 +0000 Subject: [PATCH] Use pmap_steal_memory() for the msgbuf instead of trying to squeeze it in the last chunk (phys_avail block). The last chunk very often is not larger than one or two pages, resulting in a msgbuf that's too small to hold a complete verbose boot. Note that pmap_steal_memory() will bzero the memory it "allocates". Consequently, ia64 will never preserve previous msgbufs. This is not a noticable difference in practice. If the msgbuf could be reused, it was invariably too small to have anything preserved anyway. --- sys/ia64/ia64/machdep.c | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index 4e612f06f3f1..c84a2f2a71d0 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -719,31 +719,8 @@ ia64_init(void) /* * Initialize error message buffer (at end of core). */ - { - size_t sz = round_page(MSGBUF_SIZE); - int i = phys_avail_cnt - 2; - - /* shrink so that it'll fit in the last segment */ - if (phys_avail[i+1] - phys_avail[i] < sz) - sz = phys_avail[i+1] - phys_avail[i]; - - phys_avail[i+1] -= sz; - msgbufp = (struct msgbuf*) IA64_PHYS_TO_RR7(phys_avail[i+1]); - - msgbufinit(msgbufp, sz); - - /* Remove the last segment if it now has no pages. */ - if (phys_avail[i] == phys_avail[i+1]) { - phys_avail[i] = 0; - phys_avail[i+1] = 0; - } - - /* warn if the message buffer had to be shrunk */ - if (sz != round_page(MSGBUF_SIZE)) - printf("WARNING: %ld bytes not available for msgbuf in last cluster (%ld used)\n", - round_page(MSGBUF_SIZE), sz); - - } + msgbufp = (struct msgbuf *)pmap_steal_memory(MSGBUF_SIZE); + msgbufinit(msgbufp, MSGBUF_SIZE); proc_linkup(&proc0, &ksegrp0, &kse0, &thread0); /*