Just a clarification on my previous statement "bit 30 or bit 31(== PREMPT_ACTIVE) used as a special flag between preempt_schedule and schedule. If set doesn't mean that the kernel is not elgible to call schedule and hence the condition check." should be more correctly " Bits other than used for hard irq or soft irq or preemption count" may be set to indicate special flag which is
PREEMPT_ACTIVE used between preempt_schedule and schedule(if preempt_count set to PREEMPT_ACTIVE, indicates to schedule that has been called from preempt_schedule which later unsets it.)
Thayumanavar S.