Re: [PATCH 3/3] ring-buffer: add design document




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/



Relevant Pages

  • Re: Still more linked list magic :-)
    ... if pointer deallocation succeeded ... TYPE(my_pointer), POINTER:: current! ... Check if the head of the list is allocated, ... print *, 'before calling dealloc_list:' ...
    (comp.lang.fortran)
  • Still more linked list magic :-)
    ... if pointer deallocation succeeded ... TYPE(my_pointer), POINTER:: current! ... Check if the head of the list is allocated, ... print *, 'before calling dealloc_list:' ...
    (comp.lang.fortran)
  • Re: A few basic questions about constructor & exception (in Managed C++ environment)
    ... If that doesn't sound good, my second choice would be boost::scoped_array, which is a smart pointer similar to auto_ptr, but for arrays. ... The only time I like scoped_array better than vector is when I need to allocate uninitialized memory for extreme perforamance reasons. ... Both solutions are perfectly exception safe and you can't make a mistake with them, and you don't have to worry about throwing from the construtor. ... var5 = NULL; ...
    (microsoft.public.dotnet.languages.vc)
  • [RFC][PATCH] Improve readability by hiding read_barrier_depends() calls
    ... it is sometimes difficult to figure out which pointer is ... extern void rcu_check_callbacks(int cpu, int user); ... #define list_for_each_safe_rcu(pos, n, head) \ ... * Double linked lists with a single pointer list head. ...
    (Linux-Kernel)
  • Re: Skybucks Warrior: CleanTheHouseV2
    ... org head ... contains the pointer for clearing so when it overwrites the pointer ... trail of processes that makes your warrior stronger. ... Location 'gate' is incremented continuously, ...
    (rec.games.corewar)