Commit 0088b024 authored by Philippe Gerum's avatar Philippe Gerum

sched: ipipe: add domain debug checks to common scheduling paths

Catch invalid calls of root-only code from the head domain from common
paths which may lead to blocking the current task linux-wise. Checks
are enabled by CONFIG_IPIPE_DEBUG_CONTEXT.
parent bf559171
......@@ -239,9 +239,12 @@ struct user;
#ifdef CONFIG_PREEMPT_VOLUNTARY
extern int _cond_resched(void);
# define might_resched() _cond_resched()
# define might_resched() do { \
ipipe_root_only(); \
_cond_resched(); \
} while (0)
#else
# define might_resched() do { } while (0)
# define might_resched() ipipe_root_only()
#endif
#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
......
......@@ -79,6 +79,8 @@ static int __wake_up_common(struct wait_queue_head *wq_head, unsigned int mode,
} else
curr = list_first_entry(&wq_head->head, wait_queue_entry_t, entry);
ipipe_root_only();
if (&curr->entry == &wq_head->head)
return nr_exclusive;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment