Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Apr 2001 21:23:09 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        John Baldwin <jhb@FreeBSD.ORG>
Cc:        Mark Murray <mark@grondar.za>, smp@FreeBSD.ORG
Subject:   RE: Please review - header cleanups
Message-ID:  <Pine.BSF.4.21.0104172026390.8215-100000@besplex.bde.org>
In-Reply-To: <XFMail.010416130906.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 16 Apr 2001, John Baldwin wrote:

> On 16-Apr-01 Mark Murray wrote:
> > Hi
> > 
> > The SMPng project has a TODO list at
> > http://people.freebsd.org/~jasone/smp/
> > And I grabbed what I thought would be an easy job one of
> > moving sys/mutex.h out of other "system" headers.

This is not an easy job.  It involves redesigning as many system
structs as possible (without significant loss of space or time
efficiency) to use `struct mtx *' instead of `struct mtx' so that
not so many headers depend on <sys/mutex.h> and/or moving the
declaration of `struct mtx' to its own header and including this
header instead of the full <sys/mutex.h> in system headers.

> > I have done this, and the results of my work (which compile
> > and link for the LINT case, BTW) are available at
> > http://people.freebsd.org/~markm/patches/sys.SYS_MUTEX.diff
> > so please review/test!
> 
> It will need a buildworld test as well.

Parts of userland certainly depends on <sys/mutex.h>.  The main
pollution is `struct mtx' in struct proc, struct ucred and in structs
in <net/if_var.h>.  Everything that includes <sys/user.h> will fail
the buildworld test.

> > NOTES:
> > A Helluva lot of files are affected (818, to be precise). The
> > huge majority of them are .c files. Less that 20 are .h's.

Moving the includes to files that don't depend on <sys/mutex.h>
directly just gives a larger mess.

Note that in all other cases except for networking headers and vm
headers, we have chosen spamming system headers with with includes
that they need directly over spamming .c files with includes that they
need only indirectly (due to headers not being self-sufficient).  For
network headers, this is for ancient historical reasons.  For vm
headers, it is because David Greenman was annoyed enough at the spam
in the headers to move it to .c files.  This is not the correct fix,
but it affects more like 18 files than 818 (since fundamental system
headers like <sys/proc.h> and <sys/vnode.h> don't depend on any vm
headers.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-smp" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0104172026390.8215-100000>