tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Extend "struct malloc_type" for extended KMEMSTATS?
On Fri, Jul 18, 2008 at 11:00:21AM +0200, Havard Eidnes wrote:
> Index: sys/sys/mallocvar.h
> ===================================================================
> RCS file: /u/nb/src/sys/sys/mallocvar.h,v
> retrieving revision 1.7
> diff -u -r1.7 mallocvar.h
> --- sys/sys/mallocvar.h 7 Nov 2007 16:12:25 -0000 1.7
> +++ sys/sys/mallocvar.h 18 Jul 2008 06:53:12 -0000
> @@ -48,15 +48,15 @@
> const char *ks_shortdesc;/* short description */
>
> /* Statistics */
> - u_long ks_inuse; /* # of packets of this type currently in use */
> + size_t ks_inuse; /* # of packets of this type currently in use */
> u_long ks_calls; /* total packets of this type ever allocated */
> - u_long ks_memuse; /* total memory held in bytes */
> + size_t ks_memuse; /* total memory held in bytes */
> + size_t ks_maxused; /* maximum number ever used */
> + size_t ks_limit; /* most that are allowed to exist */
> + size_t ks_size; /* sizes of this thing that are allocated */
> u_short ks_limblocks; /* number of times blocked for hitting limit */
> u_short ks_mapblocks; /* number of times blocked for kernel map */
> - u_long ks_maxused; /* maximum number ever used */
> - u_long ks_limit; /* most that are allowed to exist */
> - u_long ks_size; /* sizes of this thing that are allocated */
> - u_long ks_spare;
> + u_int ks_active[32]; /* number of active allocations per size */
> };
Put the u_long after the 'const char *'.
I'm not sure that using u_short is necessary.
If the structure gets copied to userspace you want fixed sized types.
Otherwise what is wrong with 'unsigned int' (instead of size_t).
David
--
David Laight: david%l8s.co.uk@localhost
Home |
Main Index |
Thread Index |
Old Index