integer overflow in bufinit() on large-memory machines
Kris Kennaway
kris at obsecurity.org
Tue Sep 20 12:15:33 PDT 2005
On Tue, Sep 20, 2005 at 12:57:40PM -0400, Kris Kennaway wrote:
> I have a sparc64 machine with 10GB of RAM that is hanging at boot in
> bufinit() (also seen on other sparc64 machines with more than this
> amount of RAM). Instrumenting the code shows that it's happening
> here:
>
> /*
> * To support extreme low-memory systems, make sure hidirtybuffers cannot
> * eat up all available buffer space. This occurs when our minimum cannot
> * be met. We try to size hidirtybuffers to 3/4 our buffer space assuming
> * BKVASIZE'd (8K) buffers.
> */
> while (hidirtybuffers * BKVASIZE > 3 * hibufspace / 4) {
> hidirtybuffers >>= 1;
> }
> lodirtybuffers = hidirtybuffers / 2;
>
> because 3*hibufspace is overflowing the 32-bit int hibufspace (this
> code was added a few years ago by dillon).
>
> hidirtybuffers=18182 BKVASIZE=16384 hibufspace=1189625856
BTW, on a 16gb amd64 machine I get this:
hidirtybuffers=3462, BKVASIZE=16384, hibufspace=224968704, 3 * hibufspace=674906112
so amd64 is not hitting the problem because it's sizing things very
differently.
Kris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20050920/4429c5db/attachment.bin
More information about the freebsd-current
mailing list