Re: [PATCH 3/3] ring-buffer: add design document
From: Steven Rostedt
Date: Wed Jun 10 2009 - 23:25:57 EST
On Thu, 11 Jun 2009, Hidetoshi Seto wrote:
> Steven Rostedt wrote:
> > +
> > + +------+
> > + |reader| RING BUFFER
> > + |page |-------------------+
> > + +------+ <---------------+ v
> > + | ^ +---+ +---+ +---+
> > + | | | |-->| |-->| |
> > + | | | |<--| |<--| |<-+
> > + | | +---+ +---+ +---+ |
> > + | | | ^ | |
> > + | | +-------------+ | |
> > + | +-----------------------------+ |
> > + +------------------------------------+
>
> It seems the middle of three pages have 2 prev arrows... ?
Yes that is a mistake. Thanks, I'll fix it.
> > +
> > +It does a cmpxchg with the pointer to the previous head page to make it
> > +point to the reader page. Note that the new pointer does not have the HEADER
> > +flag set. This action atomically moves the head page forward.
> > +
> > + +------+
> > + |reader| RING BUFFER
> > + |page |-------H-----------+
> > + +------+ <---------------+ v
> > + | ^ +---+ +---+ +---+
> > + | | | |-->| |-->| |
> > + | | | |<--| |<--| |<-+
> > + | | +---+ +---+ +---+ |
> > + | | | ^ | |
> > + | | +-------------+ | |
> > + | +-----------------------------+ |
> > + +------------------------------------+
> > +
>
> Ditto.
Ditto too ;-)
Thanks,
-- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/