(unknown charset) Re: Panic linux ldconfig with MUTEX_PROFILING

From: (unknown charset) Bruce Evans <bde_at_zeta.org.au>
Date: Thu, 10 Jul 2003 20:40:27 +1000 (EST)
On Thu, 10 Jul 2003, Dag-Erling [iso-8859-1] Smørgrav wrote:

> Jun Kuriyama <kuriyama_at_imgsrc.co.jp> 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:	alc
% ----------------------------

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
Received on Thu Jul 10 2003 - 01:40:42 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:14 UTC