From owner-freebsd-current@FreeBSD.ORG Mon Oct 22 16:43:17 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0065516A418 for ; Mon, 22 Oct 2007 16:43:16 +0000 (UTC) (envelope-from freebsd-current@m.gmane.org) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id A8D7F13C4AA for ; Mon, 22 Oct 2007 16:43:16 +0000 (UTC) (envelope-from freebsd-current@m.gmane.org) Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Ik0MU-0004C2-9r for freebsd-current@freebsd.org; Mon, 22 Oct 2007 16:42:42 +0000 Received: from 89-172-59-139.adsl.net.t-com.hr ([89.172.59.139]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 22 Oct 2007 16:42:42 +0000 Received: from ivoras by 89-172-59-139.adsl.net.t-com.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 22 Oct 2007 16:42:42 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-current@freebsd.org From: Ivan Voras Date: Mon, 22 Oct 2007 18:42:36 +0200 Lines: 21 Message-ID: References: <471BDA2E.9040801@elischer.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 89-172-59-139.adsl.net.t-com.hr User-Agent: Thunderbird 2.0.0.0 (X11/20070527) In-Reply-To: <471BDA2E.9040801@elischer.org> Sender: news 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: Mon, 22 Oct 2007 16:43:17 -0000 Julian Elischer wrote: > Here is the link to the next patch. > > this introduces (back) the kthread_create (etc) calls but now they > make threads.. > it may also be worth adding some help for people to make a new kproc, > and populate it with a number of kthreads. For example, why would we do that? :) A practical example: GEOM modules often spawn separate execution contexts to handle non-trivial IO requests. These threads are usually created at most once per GEOM device and live until that device goes away. GEOM framework itself has several execution contexts (g_up, g_down, g_event) which call "methods" from GEOM classes. Should we spawn one "dummy" kproc per GEOM class and then kthreads in it for devices? If "raw" kthreads can be spawned, to which kproc will they belong (if any)? Is the difference between kthread and kproc here purely aesthetic? In other words: when should one create a kproc and when a kthread?