• Steven Rostedt (VMware)'s avatar
    tracing: Disable preemption when using the filter buffer · 6c536d76
    Steven Rostedt (VMware) authored
    In case trace_event_buffer_lock_reserve() is called with preemption
    enabled, the algorithm that defines the usage of the per cpu filter buffer
    may fail if the task schedules to another CPU after determining which
    buffer it will use.
    
    Disable preemption when using the filter buffer. And because that same
    buffer must be used throughout the call, keep preemption disabled until
    the filter buffer is released.
    
    This will also keep the semantics between the use case of when the filter
    buffer is used, and when the ring buffer itself is used, as that case also
    disables preemption until the ring buffer is released.
    
    Link: https://lkml.kernel.org/r/20211130024318.880190623@goodmis.org
    
    [ Fixed warning of assignment in if statement
      Reported-by: kernel test robot <lkp@intel.com> ]
    Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
    6c536d76
trace.h 62.8 KB