Re: [PATCH 3/3] ring-buffer: add design document
- From: Steven Rostedt <rostedt@xxxxxxxxxxx>
- Date: Wed, 10 Jun 2009 23:25:46 -0400 (EDT)
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/
- References:
- [PATCH 0/3] [GIT PULL][for 2.6.32] lockless ring buffer
- From: Steven Rostedt
- [PATCH 3/3] ring-buffer: add design document
- From: Steven Rostedt
- Re: [PATCH 3/3] ring-buffer: add design document
- From: Hidetoshi Seto
- [PATCH 0/3] [GIT PULL][for 2.6.32] lockless ring buffer
- Prev by Date: Re: [PATCH 1/3] ring-buffer: make the buffer a true circular link list
- Next by Date: Re: [PATCH 1/4] Properly account for the number of page cache pages zone_reclaim() can reclaim
- Previous by thread: Re: [PATCH 3/3] ring-buffer: add design document
- Next by thread: Re: [PATCH 3/3] ring-buffer: add design document
- Index(es):
Relevant Pages
|