AARGH! btoc() is used in the MI buffer sizing routines to calculate

the minimum of either physmem or KVA.  But.. btoc() casts the address
to (unsigned int).  This is NOT GOOD on 64 bit machines and on alpha and
ia64, this results in a buffer limit of around 500K (not megs).  This
causes extreme disk access problems on alpha and ia64.  Since this cast
is simply to ensure that it is unsigned, use 'vm_offset_t' instead.  This
is available because it is already defined in types.h.

Alpha has been suffering from this for ages. It always felt like the
caching wasn't working, and unfortunately it turned out that way. :-(
This commit is contained in:
peter 2002-08-30 00:29:52 +00:00
parent b085f4e6d2
commit f96820418e

View File

@ -152,7 +152,7 @@
/* bytes to clicks */
#ifndef btoc
#define btoc(x) (((unsigned)(x)+PAGE_MASK)>>PAGE_SHIFT)
#define btoc(x) (((vm_offset_t)(x)+PAGE_MASK)>>PAGE_SHIFT)
#endif
/*