From owner-freebsd-current@FreeBSD.ORG Tue Feb 18 19:15:51 2014 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 77E17B12; Tue, 18 Feb 2014 19:15:51 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4CEB618F0; Tue, 18 Feb 2014 19:15:51 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 41ED7B988; Tue, 18 Feb 2014 14:15:50 -0500 (EST) From: John Baldwin To: freebsd-current@freebsd.org Subject: Re: [CFT] new sendfile(2) Date: Tue, 18 Feb 2014 13:28:26 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <20140217111635.GL26785@glebius.int.ru> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201402181328.26553.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 18 Feb 2014 14:15:50 -0500 (EST) Cc: Gleb Smirnoff , David Chisnall , current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 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, 18 Feb 2014 19:15:51 -0000 On Monday, February 17, 2014 6:24:21 am David Chisnall wrote: > P.S. If aio() is creating a new thread per request, rather than scheduling them from a pool, then that is also likely a bug. The aio APIs were designed so that systems with DMA controllers could issue DMA requests in the syscall and return immediately, then trigger the notification in response to the DMA- finished interrupt. There shouldn't need to be any kernel threads created to do this... AIO uses a pool, but the requests are all done synchronously from that pool. While our low-level disk routines are async (e.g. GEOM etc.), the filesystem code above that generally is not. The aio code does have some special gunk in place for sockets (and I believe raw disk I/O) to make it truly async, but aio for files uses sychronous I/O from a pool of worker threads. -- John Baldwin