Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Feb 2014 11:23:38 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-arch@freebsd.org
Cc:        Alfred Perlstein <bright@mu.org>
Subject:   Re: mbuf and uio
Message-ID:  <201402071123.38516.jhb@freebsd.org>
In-Reply-To: <52F50501.8080708@mu.org>
References:  <CAKoxK%2B6JpQT9F_2Vt8Zxk1A4ajYx3D-j2G5qdeXsA4Lg3YJC8g@mail.gmail.com> <52F50501.8080708@mu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402071123.38516.jhb>