From owner-freebsd-current@FreeBSD.ORG Tue Oct 23 08:58:17 2007 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EF4116A420 for ; Tue, 23 Oct 2007 08:58:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from gnome.kiev.sovam.com (gnome.kiev.sovam.com [212.109.32.24]) by mx1.freebsd.org (Postfix) with ESMTP id EE28A13C4C5 for ; Tue, 23 Oct 2007 08:58:16 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from relay02.kiev.sovam.com ([62.64.120.197]) by gnome.kiev.sovam.com with esmtp (Exim 4.67 (FreeBSD)) (envelope-from ) id 1IkFaM-000NX1-HQ for current@freebsd.org; Tue, 23 Oct 2007 11:58:02 +0300 Received: from [212.82.216.226] (helo=deviant.kiev.zoral.com.ua) by relay02.kiev.sovam.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.67) (envelope-from ) id 1IkFaK-0008bZ-Hc for current@freebsd.org; Tue, 23 Oct 2007 11:58:01 +0300 Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.1/8.14.1) with ESMTP id l9N8vuZw081634; Tue, 23 Oct 2007 11:57:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.1/8.14.1/Submit) id l9N8vukN081633; Tue, 23 Oct 2007 11:57:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 23 Oct 2007 11:57:56 +0300 From: Kostik Belousov To: Julian Elischer Message-ID: <20071023085755.GI2012@deviant.kiev.zoral.com.ua> References: <471BDA2E.9040801@elischer.org> <471D1146.2050502@samsco.org> <471D49D4.5010607@elischer.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mXDO3udm/xYWQeMQ" Content-Disposition: inline In-Reply-To: <471D49D4.5010607@elischer.org> User-Agent: Mutt/1.4.2.3i X-Scanner-Signature: 4fe2b897d4d72954524b6b73d18f8617 X-DrWeb-checked: yes X-SpamTest-Envelope-From: kostikbel@gmail.com X-SpamTest-Group-ID: 00000000 X-SpamTest-Info: Profiles 1656 [Oct 23 2007] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {received from trusted relay: not dialup} X-SpamTest-Method: none X-SpamTest-Method: Local Lists X-SpamTest-Rate: 0 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0255], KAS30/Release Cc: current@freebsd.org Subject: Re: kthreads->kproc and back to kthread.. next patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 23 Oct 2007 08:58:17 -0000 --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--