Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Oct 2007 11:57:56 +0300
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Julian Elischer <julian@elischer.org>
Cc:        current@freebsd.org
Subject:   Re: kthreads->kproc and back to kthread.. next patch
Message-ID:  <20071023085755.GI2012@deviant.kiev.zoral.com.ua>
In-Reply-To: <471D49D4.5010607@elischer.org>
References:  <471BDA2E.9040801@elischer.org> <471D1146.2050502@samsco.org> <471D49D4.5010607@elischer.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--mXDO3udm/xYWQeMQ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Oct 22, 2007 at 06:09:40PM -0700, Julian Elischer wrote:
> >The kernel is a single unified address space; I thought
> >that the only real benefit to "true" kthreads was just elimination of
> >duplication of vmspaces for all off the kthreads that are currently
> >running around.=20
>=20
> yes, and the overhead that goes with it. i.e. double the number of=20
> processes on an average system -> extra contention on process related loc=
ks=20
> etc.

kproc_create() specifies RFMEM for the fork1() call, thus vmspace is
actually already shared.

Some time ago I have reported to alc@ (and I suspect this is what might
catalyzed the efforts) is that, for instance, nfs client creating kproc
for nfsiod while holding vnode locks easily leads to deadlock.

In the dump supplied by Peter Holm, nfs client trying to do
kproc_create() attempted to hold allproc_lock inside fork1() and held
some vnode lock. Other process in the page fault handler held vm map
lock and tried to acquire the vnode lock. To finish the lock loop,
sysctl handler vmtotal() aquired allproc lock and waited for lock of
the vm map.

Using kthread instead of kproc would eliminate allproc and related
locking.

--mXDO3udm/xYWQeMQ
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (FreeBSD)

iD8DBQFHHbeTC3+MBN1Mb4gRAmGxAKCmcpd2r48asxR3cesSyIKZ6sPQXACbBpMN
tT5cgPb4i/xl/hy32p2uzlw=
=fc+O
-----END PGP SIGNATURE-----

--mXDO3udm/xYWQeMQ--



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