What's the meaning of PREEMPT_ACTIVE in preempt_count?

Parmenides mobile.parmenides at gmail.com
Sun Nov 6 21:38:05 EST 2011


Hi,

   The preempt_count contains a PREEMPT_ACTIVE flag. In cond_resched()
and preempt_schedule(), there is a pattern which is like this:

                add_preempt_count(PREEMPT_ACTIVE);
                schedule();
                sub_preempt_count(PREEMPT_ACTIVE);

I wonder what's the role which PREEMPT_ACTIVE plays. Why we need to
add to it before schedule() and sub from it after?



More information about the Kernelnewbies mailing list