From owner-freebsd-current@FreeBSD.ORG Sun Oct 21 17:59:32 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 2035516A4EA for ; Sun, 21 Oct 2007 17:59:32 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outO.internet-mail-service.net (outO.internet-mail-service.net [216.240.47.238]) by mx1.freebsd.org (Postfix) with ESMTP id 15B3613C4B2 for ; Sun, 21 Oct 2007 17:59:30 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Sat, 20 Oct 2007 13:59:44 -0700 X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id CB53312673F; Sat, 20 Oct 2007 13:59:43 -0700 (PDT) Message-ID: <471A6C56.7010903@elischer.org> Date: Sat, 20 Oct 2007 14:00:06 -0700 From: Julian Elischer User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Johan Bucht References: <947010c30710201200t40f1d2eyef9cfa02e1cba12f@mail.gmail.com> In-Reply-To: <947010c30710201200t40f1d2eyef9cfa02e1cba12f@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: kthread vs kproc 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: Sun, 21 Oct 2007 17:59:32 -0000 Johan Bucht wrote: > Excellent, I was planning on prodding someone about this a while back, > hope this will give some measurable performance improvements without > sacrificing stability. > How much will this affect debuggability, will there be a higher chance > of thrashed call stacks and thus non-valid panic traces? > > Feels a bit strange that some callers expect a process when calling a > function that says it creates a thread, but I guess it's a bit late to > complain that noone made a kproc macro for aio et al. > What does aio actually need that requires it to run as a process? Aio actually needs to hook the user's address space into its own (it adds itself as a second user of the calling procesess's address space) so it can do the IO easily. As such it needs a separate process so that it can have an address space to do it with. My suggested work-around is to make the AIO an invisible kernel thread attached to the process that does the IO. that way it automatically has the right address space to work on. > > /Johan