initrd allocation

Nathan Lynch ntl at pobox.com
Sat Jan 14 02:42:07 EST 2006


Paul Nasrat wrote:
> On Thu, 2006-01-12 at 22:54 -0600, Nathan Lynch wrote:
> > Hi-
> > 
> > I have a system where claim is failing for an initrd only slightly
> > larger than 4096K.
> 
> Out of curiosity what system?

Some JS21 blades.  Haven't been able to pin down what configurations
account for the failure yet.


> >   The initial 4MB allocation succeeds, but when we
> > try to grab another 4MB, the claim fails.  However, yaboot doesn't
> > seem to handle this case properly and continues to boot the kernel
> > with a truncated initrd.
> 
> If you are looking at claims you might also look at the attached patch
> from Dave Woodhouse which tries harder to allocate.

Looks good.

> > This is with a vendor version of yaboot based on 1.3.12, but looks
> > like upstream would have the same problem.
> 
> > Couple of questions:
> > 
> > 1) Is there some historical reason for INITRD_CHUNKSIZE to be as large
> >    as it is?  I have worked around the issue by defining it to
> >    0x100000.
> 
> I'm not sure of hand. Sadly the archives are not available.  Could you
> summarise your testing with this change, and perhaps we can test on a
> few more platforms.

So far just JS21 and a Power3 44P-270 (and only booting from cd).  I
can get it more testing on IBM stuff.

> 
> > 2) If a "secondary" claim fails, shouldn't we assert/prom_pause or
> >    something?
> 
> This sounds reasonable.

Great, here's a patch for that.


--- head.orig/second/yaboot.c
+++ head/second/yaboot.c
@@ -979,6 +979,7 @@ yaboot_text_ui(void)
 			      initrd_more = prom_claim(initrd_want, INITRD_CHUNKSIZE, 0);
 			      if (initrd_more != initrd_want) {
 				   prom_printf("Claim failed for initrd memory at %p rc=%p\n",initrd_want,initrd_more);
+				   prom_pause();
 				   break;
 			      }
 			      initrd_read = file.fs->read(&file, INITRD_CHUNKSIZE, initrd_more);



More information about the Yaboot-devel mailing list