• S
    ring_buffer: implement new locking · d769041f
    Steven Rostedt 提交于
    The old "lock always" scheme had issues with lockdep, and was not very
    efficient anyways.
    
    This patch does a new design to be partially lockless on writes.
    Writes will add new entries to the per cpu pages by simply disabling
    interrupts. When a write needs to go to another page than it will
    grab the lock.
    
    A new "read page" has been added so that the reader can pull out a page
    from the ring buffer to read without worrying about the writer writing over
    it. This allows us to not take the lock for all reads. The lock is
    now only taken when a read needs to go to a new page.
    
    This is far from lockless, and interrupts still need to be disabled,
    but it is a step towards a more lockless solution, and it also
    solves a lot of the issues that were noticed by the first conversion
    of ftrace to the ring buffers.
    
    Note: the ring_buffer_{un}lock API has been removed.
    Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
    Signed-off-by: NIngo Molnar <mingo@elte.hu>
    d769041f
ring_buffer.c 40.6 KB