Date: Mon, 30 Dec 2002 14:58:30 +1100 (EST) From: Bruce Evans <bde@zeta.org.au> To: Poul-Henning Kamp <phk@FreeBSD.org> Cc: cvs-committers@FreeBSD.org, <cvs-all@FreeBSD.org> Subject: Re: cvs commit: src/sys/sys _mutex.h Message-ID: <20021230142740.R44529-100000@gamplex.bde.org> In-Reply-To: <200212291114.gBTBEfR7028038@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 29 Dec 2002, Poul-Henning Kamp wrote: > phk 2002/12/29 03:14:41 PST > > Modified files: > sys/sys _mutex.h > Log: > 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. Not so. This breaks all modules, not just foreign ones, since opt_global.h is not included in any module, and even if it were then its setting for some modules might differ from the setting in the kernel. Please have future changes to headers reviewed by people familiar with the headers. Rev.1.7 intentionally removed a commented-out MUTEX_PROFILING ifdef which erroneously suggested that such an ifdef might work. In a review of rev.1.7, it claimed out that there is no problem for modules since modules use only extern functions to access mutexes. This is wrong because a kernel compiled with MUTEX_PROFILING will blindly access struct members that don't exist in mutexes that are allocated in modules compiled without MUTEX_PROFILING (i.e., in all modules) if the mutex profiling struct members are ifdefed. In any case, variant structs are fragile and give undefined behaviour. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021230142740.R44529-100000>