Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Apr 2004 08:52:04 -0700
From:      Wes Peters <wes@softweyr.com>
To:        freebsd-current@freebsd.org
Cc:        "M. Warner Losh" <imp@bsdimp.com>
Subject:   Re: DEVFS in a chroot?
Message-ID:  <200404300852.04723.wes@softweyr.com>
In-Reply-To: <7432.1083333726@critter.freebsd.dk>
References:  <7432.1083333726@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 30 April 2004 07:02, Poul-Henning Kamp wrote:
> In message <20040430.075448.70646001.imp@bsdimp.com>, "M. Warner Losh" 
writes:
> >In message: <6695.1083331489@critter.freebsd.dk>
> >
> >            "Poul-Henning Kamp" <phk@phk.freebsd.dk> writes:
> >: In message <20040430.070341.26991317.imp@bsdimp.com>, "M. Warner Losh" 
writes:
> >: >In message: <5473.1083327210@critter.freebsd.dk>
> >: >
> >: >            "Poul-Henning Kamp" <phk@phk.freebsd.dk> writes:
> >: >: >Should I mount /var/chroot/dev as type devfs?
> >: >:
> >: >: Yes:
> >: >:
> >: >: 	mount -t devfs randomargument	/var/chroot/dev
> >: >
> >: >What if I have hundreds of these chroots?  We build our product
> >: > inside a chroot right now and I'm worried what the overhead of
> >: >mounting/unmounting this for every build would be...
> >:
> >: As far as I recall, our mountlist handling is not optimised for
> >: hundreds of simultaneous mountpoints: we basically walk the list.
> >: That said, I belive we only do so during the actual mount/unmount
> >: operations, so I do not think there is a performance issue as such.
> >
> >Would the performance issues be mitigated by mounting/unmounting devfs
> >all the time?  Eg, only mount it while it is actively being used?
>
> I think you would actually make it worse that way...

We do this on our build box -- mount and unmount both devfs and a read-only 
source directory, chroot, and build, as in:

/usr/wes/products on /usr/obj/buildenvs/usr/wes/products/iamsrc (nullfs, 
local, read-only)
devfs on /usr/obj/buildenvs/usr/wes/products/dev (devfs, local)

And then unmount once the build has completed.  We have 'chroot' and 
'unmount' targets in the top-level makefile to get back into and out of the 
chroot as well.

On 5.2.1, our build box hangs once or twice a week on an unmount.  I'm not 
sure if it's the nullfs or the devfs unmount.  I haven't had time to debug 
this, I've been ankle deep (head first) in PHP and Perl code that are the 
guts of my product for 6 weeks now, but I'll try to catch it in the 
debugger next week once the smoke clears.

I run -CURRENT on my workstation and it has not hung in a while, but it 
doesn't get pounded the way the buildbox does.  Is there some resource 
related to mounts that might be getting leaked?

-- 

        Where am I, and what am I doing in this handbasket?

Wes Peters                                               wes@softweyr.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200404300852.04723.wes>