cvs commit: src/sys/sys mbuf.h src/sys/kern uipc_mbuf.c uipc_syscalls.c src/usr.bin/netstat mbuf.c src/lib/libc/sys sendfile.2

Alan Cox alc at cs.rice.edu
Thu Jun 17 16:22:20 PDT 2004


On Thu, Jun 17, 2004 at 06:03:13PM -0400, Mike Silbersack wrote:
> > On Fri, Jun 18, 2004 at 03:48:13AM +0700, Max Khon wrote:
> >
> > This particular change is a case of nit-picking.  It's small, hard to
> > imagine how it could effect someone, etc.  But even Bosko said more
> > caution 'next time' would be good, I'm just emphasizing why.  To some
> > extent the output of programs has been an API ever since pipes were
> > invented.  And unless I'm severely mistaken one of the things we have
> > tried to avoid is changing API's once a branch goes -STABLE.
> >
> > --
> > 						Ken Smith
> 
> Yes, you hit it right on the head, this IS a case of nitpicking.
> 
> sfbufs are used almost exclusively in conjunction with mbufs, and users
> who are interested in mbuf usage will certainly be interested in sfbuf
> usage.  This is why I displayed the information along with mbuf
> statistics, and why I see no reason to add yet another switch to netstat
> (or would it be sfstat?)

This is true of RELENG_4.  In HEAD sf_bufs are very different.  They
are used to implement pipes, swap-backed mds, exec_map_first_page(),
and the vnode pager.  In other words, many places where the kernel
would create a single-page ephemeral mapping.  The sf_buf API has been
refactored to facilitate architecture-specific optimizations.  For
example, on architectures with a direct virtual-to-physical mapping.
An sf_buf is nothing more than a cast.  In contrast, on i386, we
maintain a reference-counted, LRU-managed cache of virtual-to-physical
mappings, eliminating many (expensive) TLB invalidations and
interprocessor shootdowns.  (This also benefits sendfile(2) because
concurrent sends of the same file share the same reference-counted
sf_bufs, rather than each allocating their own private sf_bufs for
mapping the same page(s).)

In Dragonfly, I believe is starting to use sf_bufs to reimplement
the buffer cache.

Regards,
Alan


More information about the cvs-src mailing list