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.
This commit is contained in:
parent
97e9a3336d
commit
0d2e39083f
@ -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);
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user