From owner-cvs-all Sun Dec 29 19:56:40 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 298A337B405; Sun, 29 Dec 2002 19:56:38 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7CAD343E4A; Sun, 29 Dec 2002 19:56:36 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id OAA08621; Mon, 30 Dec 2002 14:56:33 +1100 Date: Mon, 30 Dec 2002 14:58:30 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Poul-Henning Kamp Cc: cvs-committers@FreeBSD.org, Subject: Re: cvs commit: src/sys/sys _mutex.h In-Reply-To: <200212291114.gBTBEfR7028038@repoman.freebsd.org> Message-ID: <20021230142740.R44529-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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