From owner-freebsd-arch@FreeBSD.ORG Fri Feb 7 16:32:32 2014 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 803A51E5 for ; Fri, 7 Feb 2014 16:32:32 +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 5053B107E for ; Fri, 7 Feb 2014 16:32:32 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 24104B926; Fri, 7 Feb 2014 11:32:31 -0500 (EST) From: John Baldwin To: freebsd-arch@freebsd.org Subject: Re: mbuf and uio Date: Fri, 7 Feb 2014 11:23:38 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <52F50501.8080708@mu.org> In-Reply-To: <52F50501.8080708@mu.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201402071123.38516.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 07 Feb 2014 11:32:31 -0500 (EST) Cc: Alfred Perlstein X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Feb 2014 16:32:32 -0000 On Friday, February 07, 2014 11:08:33 am Alfred Perlstein wrote: > On 2/7/14 4:51 AM, Luca Ferrari wrote: > > Hi all, > > I'm just wondering why mbufs seems to be much more important from an > > administrator point of view than uio. I mean, both structures are used > > to move data thru a stack (network or i/o), but the mbufs get > > accounted by serveral tools (like netstat and so on) while uio does > > not. > > Am I totally wrong on this? > uios are transient structures that can be allocated on the stack at any > time. In general you'll have at most 1 uio per process/thread active. > > tracking them would not really gain us much. The other thing is that uios do not allocate their own storage for I/O buffers. They merely serve as metadata so that data can be copied between userland buffers and other buffers in the kernel (such as the VM pages that back a file). The actual data used for I/O does not belong to the uio. mbufs, on the other hand, store packet data. -- John Baldwin