Save 16 bytes per mutex if MUTEX_PROFILING is not defined.

MUTEX_PROFILING is in opt_global.h, so this does not introduce a risk of
variant structure sizes unless foreign kernel modules are used.

This saved 16 bytes per vnode and 16 bytes per vm object for a total of
4MB on a 2GB machine.

Idea from:	alc
This commit is contained in:
Poul-Henning Kamp 2002-12-29 11:14:41 +00:00
parent 851a87ea1a
commit 34dda7fac8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=108389

View File

@ -41,10 +41,15 @@ struct mtx {
TAILQ_HEAD(, thread) mtx_blocked; /* Threads blocked on us. */
LIST_ENTRY(mtx) mtx_contested; /* Next contested mtx. */
/* Fields used only if MUTEX_PROFILING is configured: */
#ifdef MUTEX_PROFILING
/*
* This does not result in variant structure sizes because
* MUTEX_PROFILING is in opt_global.h
*/
u_int64_t mtx_acqtime;
const char *mtx_filename;
int mtx_lineno;
#endif
};
#endif /* !_SYS__MUTEX_H_ */