Force the "calls" count for malloc types to be 64 bit where it keeps track

of the number of times a particular type has been used.  It's rather easy
to overflow.  One site I'm looking at seems to do it in a matter of days.
On the Alpha this is a no-op since 'long' is 64 bit already.  The sole
user of this interface seems to be vmstat -m and friends which will need
a recompile.  The overheads of using a 64 bit int should be pretty light
as the kernel just does "calls++" type operations and that's it.
This commit is contained in:
Peter Wemm 1999-10-01 14:21:50 +00:00
parent fe49e6c57c
commit 3076c7c50d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=51842

View File

@ -57,7 +57,7 @@ struct malloc_type {
long ks_limit; /* most that are allowed to exist */
long ks_size; /* sizes of this thing that are allocated */
long ks_inuse; /* # of packets of this type currently in use */
long ks_calls; /* total packets of this type ever allocated */
int64_t ks_calls; /* total packets of this type ever allocated */
long ks_maxused; /* maximum number ever used */
u_long ks_magic; /* if it's not magic, don't touch it */
const char *ks_shortdesc; /* short description */
@ -100,10 +100,10 @@ struct kmemusage {
struct kmembuckets {
caddr_t kb_next; /* list of free blocks */
caddr_t kb_last; /* last free block */
int64_t kb_calls; /* total calls to allocate this size */
long kb_total; /* total number of blocks allocated */
long kb_elmpercl; /* # of elements in this sized allocation */
long kb_totalfree; /* # of free elements in this bucket */
long kb_calls; /* total calls to allocate this size */
long kb_highwat; /* high water mark */
long kb_couldfree; /* over high water mark and could free */
};