/* * must be macros to avoid header recursion hell
*/ #define init_task_preempt_count(p) do { \
task_thread_info(p)->preempt_count = FORK_PREEMPT_COUNT; \
} while (0)
#define init_idle_preempt_count(p, cpu) do { \
task_thread_info(p)->preempt_count = PREEMPT_DISABLED; \
} while (0)
static __always_inline bool __preempt_count_dec_and_test(void)
{ /* * Because of load-store architectures cannot do per-cpu atomic * operations; we cannot use PREEMPT_NEED_RESCHED because it might get * lost.
*/ return !--*preempt_count_ptr() && tif_need_resched();
}
/* * Returns true when we need to resched and can (barring IRQ state).
*/ static __always_inline bool should_resched(int preempt_offset)
{ return unlikely(preempt_count() == preempt_offset &&
tif_need_resched());
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.