From owner-freebsd-current@FreeBSD.ORG Thu Jul 10 03:40:42 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4E44337B401 for ; Thu, 10 Jul 2003 03:40:42 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3988A43F93 for ; Thu, 10 Jul 2003 03:40:41 -0700 (PDT) (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.3p2/8.8.7) with ESMTP id UAA24490; Thu, 10 Jul 2003 20:40:29 +1000 Date: Thu, 10 Jul 2003 20:40:27 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= In-Reply-To: Message-ID: <20030710202221.J25371@gamplex.bde.org> References: <7msmpv3lq0.wl@black.imgsrc.co.jp> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN Content-Transfer-Encoding: QUOTED-PRINTABLE cc: Jun Kuriyama cc: Current Subject: Re: Panic linux ldconfig with MUTEX_PROFILING X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jul 2003 10:40:42 -0000 On Thu, 10 Jul 2003, Dag-Erling [iso-8859-1] Sm=F8rgrav wrote: > Jun Kuriyama writes: > > I'm trying to use MUTEX_PROFILING, but paniced in linux ldconfig. > > Any clues? > > is COMPAT_LINUX compiled into the kernel? You can't use modules with > MUTEX_PROFILING; it changes the size and layout of struct mtx, and > since modules aren't built with the same options as the kernel, they > use the wrong struct mtx. This was broken in rev.1.9 of _mutex.h: % RCS file: /home/ncvs/src/sys/sys/_mutex.h,v % Working file: _mutex.h % head: 1.9 % ... % ---------------------------- % revision 1.9 % date: 2002/12/29 11:14:41; author: phk; state: Exp; lines: +6 -1 % 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:=09alc % ---------------------------- Actually, this ensures variant struct sizes if *any* kernel module is used. The saving is machine-dependent (24 instead of 16 on most 64-bit machines). If bloat is a problem, then there is plenty more in the mutex struct (not to mention the vnode struct) that could be attacked (mainly for LOCK_DEBUG in the case of mutexes). I think mutex profiling should use external data, but this would be less efficient and more work to implement. Perhaps similarly for LOCK_DEBUG, but LOCK_DEBUG is still needed in most configurations, unlike MUTEX_PROFILING. Bruce