1. 21 1月, 2009 2 次提交
    • L
      ring_buffer: reset write when reserve buffer fail · 551b4048
      Lai Jiangshan 提交于
      Impact: reset struct buffer_page.write when interrupt storm
      
      if struct buffer_page.write is not reset, any succedent committing
      will corrupted ring_buffer:
      
      static inline void
      rb_set_commit_to_write(struct ring_buffer_per_cpu *cpu_buffer)
      {
      	......
      		cpu_buffer->commit_page->commit =
      			cpu_buffer->commit_page->write;
      	......
      }
      
      when "if (RB_WARN_ON(cpu_buffer, next_page == reader_page))", ring_buffer
      is disabled, but some reserved buffers may haven't been committed.
      we need reset struct buffer_page.write.
      
      when "if (unlikely(next_page == cpu_buffer->commit_page))", ring_buffer
      is still available, we should not corrupt it.
      Signed-off-by: NLai Jiangshan <laijs@cn.fujitsu.com>
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      551b4048
    • F
      tracing/function-graph-tracer: fix a regression while suspend to disk · 00f57f54
      Frederic Weisbecker 提交于
      Impact: fix a crash while kernel image restore
      
      When the function graph tracer is running and while suspend to disk, some racy
      and dangerous things happen against this tracer.
      
      The current task will save its registers including the stack pointer which
      contains the return address hooked by the tracer. But the current task will
      continue to enter other functions after that to save the memory, and then
      it will store other return addresses, and finally loose the old depth which
      matches the return address saved in the old stack (during the registers saving).
      
      So on image restore, the code will return to wrong addresses.
      And there are other things: on restore, the task will have it's "current"
      pointer overwritten during registers restoring....switching from one task to
      another... That would be insane to try to trace function graphs at these
      stages.
      
      This patch makes the function graph tracer listening on power events, making
      it's tracing disabled for the current task (the one that performs the
      hibernation work) while suspend/resume to disk, making the tracing safe
      during hibernation.
      Signed-off-by: NFrederic Weisbecker <fweisbec@gmail.com>
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      00f57f54
  2. 20 1月, 2009 1 次提交
    • S
      ring-buffer: fix alignment problem · 082605de
      Steven Rostedt 提交于
      Impact: fix to allow some archs to use the ring buffer
      
      Commits in the ring buffer are checked by pointer arithmetic.
      If the calculation is incorrect, then the commits will never take
      place and the buffer will simply fill up and report an error.
      
      Each page in the ring buffer has a small header:
      
      struct buffer_data_page {
      	u64		time_stamp;
      	local_t		commit;
      	unsigned char	data[];
      };
      
      Unfortuntely, some of the calculations used sizeof(struct buffer_data_page)
      to know the size of the header. But this is incorrect on some archs,
      where sizeof(struct buffer_data_page) does not equal
      offsetof(struct buffer_data_page, data), and on those archs, the commits
      are never processed.
      
      This patch replaces the sizeof with offsetof.
      Signed-off-by: NSteven Rostedt <srostedt@redhat.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      082605de
  3. 17 1月, 2009 26 次提交
  4. 16 1月, 2009 11 次提交