ftrace: preempt disable over interrupt disable

Previous thread: ftrace: ktime.h not included in ftrace.h by Linux Kernel Mailing List on Monday, October 20, 2008 - 3:24 pm. (1 message)

Next thread: ftrace: take advantage of variable length entries by Linux Kernel Mailing List on Monday, October 20, 2008 - 3:23 pm. (1 message)
From: Linux Kernel Mailing List
Date: Monday, October 20, 2008 - 3:24 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=386970...
Commit:     38697053fa006411224a1790e2adb8216440ab0f
Parent:     e4c2ce82ca2710e17cb4df8eb2b249fa2eb5af30
Author:     Steven Rostedt <rostedt@goodmis.org>
AuthorDate: Wed Oct 1 13:14:09 2008 -0400
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Tue Oct 14 10:39:09 2008 +0200

    ftrace: preempt disable over interrupt disable
    
    With the new ring buffer infrastructure in ftrace, I'm trying to make
    ftrace a little more light weight.
    
    This patch converts a lot of the local_irq_save/restore into
    preempt_disable/enable.  The original preempt count in a lot of cases
    has to be sent in as a parameter so that it can be recorded correctly.
    Some places were recording it incorrectly before anyway.
    
    This is also laying the ground work to make ftrace a little bit
    more reentrant, and remove all locking. The function tracers must
    still protect from reentrancy.
    
    Note: All the function tracers must be careful when using preempt_disable.
      It must do the following:
    
      resched = need_resched();
      preempt_disable_notrace();
      [...]
      if (resched)
    	preempt_enable_no_resched_notrace();
      else
    	preempt_enable_notrace();
    
    The reason is that if this function traces schedule() itself, the
    preempt_enable_notrace() will cause a schedule, which will lead
    us into a recursive failure.
    
    If we needed to reschedule before calling preempt_disable, we
    should have already scheduled. Since we did not, this is most
    likely that we should not and are probably inside a schedule
    function.
    
    If resched was not set, we still need to catch the need resched
    flag being set when preemption was off and the if case at the
    end will catch that for us.
    
    Signed-off-by: Steven Rostedt <srostedt@redhat.com>
    Signed-off-by: Ingo Molnar ...
Previous thread: ftrace: ktime.h not included in ftrace.h by Linux Kernel Mailing List on Monday, October 20, 2008 - 3:24 pm. (1 message)

Next thread: ftrace: take advantage of variable length entries by Linux Kernel Mailing List on Monday, October 20, 2008 - 3:23 pm. (1 message)